diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-05-23 14:54:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-23 14:54:29 -0700 |
commit | 352d72a30e3d113064ebc194f49560eeae34b332 (patch) | |
tree | 3e2f020592c95eab2e160ff2e1984525ce3e7638 /builtin/worktree.c | |
parent | Merge branch 'ss/commit-dry-run-resolve-merge-to-no-op' (diff) | |
parent | branch: do not rename a branch under bisect or rebase (diff) | |
download | tgif-352d72a30e3d113064ebc194f49560eeae34b332.tar.xz |
Merge branch 'nd/worktree-various-heads'
The experimental "multiple worktree" feature gains more safety to
forbid operations on a branch that is checked out or being actively
worked on elsewhere, by noticing that e.g. it is being rebased.
* nd/worktree-various-heads:
branch: do not rename a branch under bisect or rebase
worktree.c: check whether branch is bisected in another worktree
wt-status.c: split bisect detection out of wt_status_get_state()
worktree.c: check whether branch is rebased in another worktree
worktree.c: avoid referencing to worktrees[i] multiple times
wt-status.c: make wt_status_check_rebase() work on any worktree
wt-status.c: split rebase detection out of wt_status_get_state()
path.c: refactor and add worktree_git_path()
worktree.c: mark current worktree
worktree.c: make find_shared_symref() return struct worktree *
worktree.c: store "id" instead of "git_dir"
path.c: add git_common_path() and strbuf_git_common_path()
dir.c: rename str(n)cmp_icase to fspath(n)cmp
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r-- | builtin/worktree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 331ecf6761..96a2834a18 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -205,7 +205,7 @@ static int add_worktree(const char *path, const char *refname, if (!opts->detach && !strbuf_check_branch_ref(&symref, refname) && ref_exists(symref.buf)) { /* it's a branch */ if (!opts->force) - die_if_checked_out(symref.buf); + die_if_checked_out(symref.buf, 0); } else { /* must be a commit */ commit = lookup_commit_reference_by_name(refname); if (!commit) @@ -349,7 +349,7 @@ static int add(int ac, const char **av, const char *prefix) if (!opts.force && !strbuf_check_branch_ref(&symref, opts.new_branch) && ref_exists(symref.buf)) - die_if_checked_out(symref.buf); + die_if_checked_out(symref.buf, 0); strbuf_release(&symref); } |