aboutsummaryrefslogtreecommitdiff
path: root/t/t2025-worktree-add.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-04-22 20:01:35 +0700
committerJunio C Hamano <gitster@pobox.com>2016-04-22 14:09:39 -0700
commit04a3dfb8b5993fcb807fcbca8ed7ea608d30a204 (patch)
tree1d0854491c8239b41b0a9f254bec1876af9e3596 /t/t2025-worktree-add.sh
parentf5d067a2b28143dca237712e5dae7738d563f85c (diff)
downloadgit-04a3dfb8b5993fcb807fcbca8ed7ea608d30a204.tar.gz
git-04a3dfb8b5993fcb807fcbca8ed7ea608d30a204.tar.xz
worktree.c: check whether branch is bisected in another worktree
Similar to the rebase case, we want to detect if "HEAD" in some worktree is being bisected because 1) we do not want to checkout this branch in another worktree, after bisect is done it will want to go back to this branch 2) we do not want to delete the branch is either or git bisect will fail to return to the (long gone) branch Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2025-worktree-add.sh')
-rwxr-xr-xt/t2025-worktree-add.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh
index da54327f5..8f53944cb 100755
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -263,4 +263,17 @@ test_expect_success 'check out from current worktree branch ok' '
)
'
+test_expect_success 'checkout a branch under bisect' '
+ git worktree add under-bisect &&
+ (
+ cd under-bisect &&
+ git bisect start &&
+ git bisect bad &&
+ git bisect good HEAD~2 &&
+ git worktree list | grep "under-bisect.*detached HEAD" &&
+ test_must_fail git worktree add new-bisect under-bisect &&
+ ! test -d new-bisect
+ )
+'
+
test_done