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 | c79786c486cb84e2f9dad41a04d982bb23075815 (patch) | |
tree | 05d065c327325e03f31f306a4d05ea5cff9376d1 /builtin/bisect.c | |
parent | Merge branch 'zh/push-to-delete-onelevel-ref' (diff) | |
parent | bisect: fix "reset" when branch is checked out elsewhere (diff) | |
download | git-c79786c486cb84e2f9dad41a04d982bb23075815.tar.xz git-c79786c486cb84e2f9dad41a04d982bb23075815.zip |
Merge branch 'rj/bisect-already-used-branch'
Allow "git bisect reset" to check out the original branch when the
branch is already checked out in a different worktree linked to the
same repository.
* rj/bisect-already-used-branch:
bisect: fix "reset" when branch is checked out elsewhere
Diffstat (limited to 'builtin/bisect.c')
-rw-r--r-- | builtin/bisect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/bisect.c b/builtin/bisect.c index e8ee4a4dc8..c64c8d715a 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -245,7 +245,8 @@ static int bisect_reset(const char *commit) struct child_process cmd = CHILD_PROCESS_INIT; cmd.git_cmd = 1; - strvec_pushl(&cmd.args, "checkout", branch.buf, "--", NULL); + strvec_pushl(&cmd.args, "checkout", "--ignore-other-worktrees", + branch.buf, "--", NULL); if (run_command(&cmd)) { error(_("could not check out original" " HEAD '%s'. Try 'git bisect" |