diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-19 23:03:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-19 23:03:11 +0100 |
commit | 96a806f87a379fbc54b5cdb889518e9540d954c9 (patch) | |
tree | f0318d5114575e8f6d8b6fca5579d2b1e13feaa1 /worktree.h | |
parent | Merge branch 'rj/bisect-already-used-branch' (diff) | |
parent | switch: reject if the branch is already checked out elsewhere (test) (diff) | |
download | git-96a806f87a379fbc54b5cdb889518e9540d954c9.tar.xz git-96a806f87a379fbc54b5cdb889518e9540d954c9.zip |
Merge branch 'rj/avoid-switching-to-already-used-branch'
A few subcommands have been taught to stop users from working on a
branch that is being used in another worktree linked to the same
repository.
* rj/avoid-switching-to-already-used-branch:
switch: reject if the branch is already checked out elsewhere (test)
rebase: refuse to switch to a branch already checked out elsewhere (test)
branch: fix die_if_checked_out() when ignore_current_worktree
worktree: introduce is_shared_symref()
Diffstat (limited to 'worktree.h')
-rw-r--r-- | worktree.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h index 2baeca2a8a..ce45b66de9 100644 --- a/worktree.h +++ b/worktree.h @@ -149,6 +149,12 @@ const struct worktree *find_shared_symref(struct worktree **worktrees, const char *target); /* + * Returns true if a symref points to a ref in a worktree. + */ +int is_shared_symref(const struct worktree *wt, + const char *symref, const char *target); + +/* * Similar to head_ref() for all HEADs _except_ one from the current * worktree, which is covered by head_ref(). */ |