mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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()
This commit is contained in:
@@ -148,6 +148,12 @@ const struct worktree *find_shared_symref(struct worktree **worktrees,
|
||||
const char *symref,
|
||||
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().
|
||||
|
||||
Reference in New Issue
Block a user