]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/worktree.c
worktree.c: check whether branch is rebased in another worktree
[thirdparty/git.git] / builtin / worktree.c
index d8e3795dc44a0dc047cac77af92282361227111a..12c0af723e69b87c07cc152824fb2cff6930ee66 100644 (file)
@@ -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);
        }