summaryrefslogtreecommitdiff
path: root/t/t3200-branch.sh
diff options
context:
space:
mode:
authorNickolai Belakovski <nbelakovski@gmail.com>2019-04-29 05:19:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-07 04:45:54 (GMT)
commitab3138146f9ce1d819cefab4515965604de76d9d (patch)
tree7349288594a6da0eb3d6dd0ae556fe6d6745a08c /t/t3200-branch.sh
parent2582083fa1830632e298727e973440907345267f (diff)
downloadgit-ab3138146f9ce1d819cefab4515965604de76d9d.zip
git-ab3138146f9ce1d819cefab4515965604de76d9d.tar.gz
git-ab3138146f9ce1d819cefab4515965604de76d9d.tar.bz2
branch: update output to include worktree info
The output of git branch is modified to mark branches checked out in a linked worktree with a "+" and color them in cyan (in contrast to the current branch, which will still be denoted with a "*" and colored in green) This is meant to communicate to the user that the branches that are marked or colored will behave differently from other branches if the user attempts to check them out or delete them, since branches checked out in another worktree cannot be checked out or deleted. Signed-off-by: Nickolai Belakovski <nbelakovski@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 478b82c..88719cc 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -202,18 +202,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' '
@@ -774,7 +778,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' '