diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/checkout.c | 2 | ||||
-rw-r--r-- | builtin/worktree.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index efcbd8f6b5..6041718783 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1111,7 +1111,7 @@ static int checkout_branch(struct checkout_opts *opts, char *head_ref = resolve_refdup("HEAD", 0, sha1, &flag); if (head_ref && (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path))) - die_if_checked_out(new->path); + die_if_checked_out(new->path, 1); free(head_ref); } diff --git a/builtin/worktree.c b/builtin/worktree.c index d8e3795dc4..12c0af723e 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); } |