summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-24 21:25:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-24 21:25:53 (GMT)
commit8020803f5057601c1c29ffcdbd309905bd26eef7 (patch)
treed4f0bbfcd50de828c54b8187a98b821c5ad2ce21 /t
parente6a6a768ca472afed90adbbd786e5c04fff6be7b (diff)
parent17f1365dbce9aa00cab3f196e7fa7138d9081eef (diff)
downloadgit-8020803f5057601c1c29ffcdbd309905bd26eef7.zip
git-8020803f5057601c1c29ffcdbd309905bd26eef7.tar.gz
git-8020803f5057601c1c29ffcdbd309905bd26eef7.tar.bz2
Merge branch 'nd/git-common-dir-fix'
"git rev-parse --git-common-dir" used in the worktree feature misbehaved when run from a subdirectory. * nd/git-common-dir-fix: rev-parse: take prefix into account in --git-common-dir
Diffstat (limited to 't')
-rwxr-xr-xt/t2027-worktree-list.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t2027-worktree-list.sh b/t/t2027-worktree-list.sh
index 75ebb1b..1b1b65a 100755
--- a/t/t2027-worktree-list.sh
+++ b/t/t2027-worktree-list.sh
@@ -8,6 +8,16 @@ test_expect_success 'setup' '
test_commit init
'
+test_expect_success 'rev-parse --git-common-dir on main worktree' '
+ git rev-parse --git-common-dir >actual &&
+ echo .git >expected &&
+ test_cmp expected actual &&
+ mkdir sub &&
+ git -C sub rev-parse --git-common-dir >actual2 &&
+ echo sub/.git >expected2 &&
+ test_cmp expected2 actual2
+'
+
test_expect_success '"list" all worktrees from main' '
echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
test_when_finished "rm -rf here && git worktree prune" &&