"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
@ -206,18 +206,22 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
@@ -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' '