summaryrefslogtreecommitdiff
path: root/t/t3200-branch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-09 22:25:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-09 22:25:33 (GMT)
commit99eea645832d376a3b214b78a57adabf1fa96547 (patch)
tree523d1ade0aaa84b1ac0d9cda83a6e4b46f2a08d8 /t/t3200-branch.sh
parent8dca754b1e874719a732bc9ab7b0e14b21b1bc10 (diff)
parent6e9381469e3bd866e73affe6d9d96206ee7ff965 (diff)
downloadgit-99eea645832d376a3b214b78a57adabf1fa96547.zip
git-99eea645832d376a3b214b78a57adabf1fa96547.tar.gz
git-99eea645832d376a3b214b78a57adabf1fa96547.tar.bz2
Merge branch 'nb/branch-show-other-worktrees-head'
"git branch --list" learned to show branches that are checked out in other worktrees connected to the same repository prefixed with '+', similar to the way the currently checked out branch is shown with '*' in front. * nb/branch-show-other-worktrees-head: branch: add worktree info on verbose output branch: update output to include worktree info ref-filter: add worktreepath atom
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-xt/t3200-branch.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index e9d7084..411a70b 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -206,18 +206,22 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
git worktree add -f bazdir2 baz &&
git branch -M baz bam &&
test $(git -C bazdir rev-parse --abbrev-ref HEAD) = bam &&
- test $(git -C bazdir2 rev-parse --abbrev-ref HEAD) = bam
+ test $(git -C bazdir2 rev-parse --abbrev-ref HEAD) = bam &&
+ rm -r bazdir bazdir2 &&
+ git worktree prune
'
test_expect_success 'git branch -M baz bam should succeed within a worktree in which baz is checked out' '
git checkout -b baz &&
- git worktree add -f bazdir3 baz &&
+ git worktree add -f bazdir baz &&
(
- cd bazdir3 &&
+ cd bazdir &&
git branch -M baz bam &&
test $(git rev-parse --abbrev-ref HEAD) = bam
) &&
- test $(git rev-parse --abbrev-ref HEAD) = bam
+ test $(git rev-parse --abbrev-ref HEAD) = bam &&
+ rm -r bazdir &&
+ git worktree prune
'
test_expect_success 'git branch -M master should work when master is checked out' '
@@ -804,7 +808,9 @@ test_expect_success 'test deleting branch without config' '
test_expect_success 'deleting currently checked out branch fails' '
git worktree add -b my7 my7 &&
test_must_fail git -C my7 branch -d my7 &&
- test_must_fail git branch -d my7
+ test_must_fail git branch -d my7 &&
+ rm -r my7 &&
+ git worktree prune
'
test_expect_success 'test --track without .fetch entries' '