aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-05 18:05:43 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-05 18:05:43 -0800
commitf20408dadb75914460b9251b56fe4bffb5f44f48 (patch)
tree7241fcb8d3ec78b25c5504d2985caebef2965cbe /t
parent141b6b83d7ca5bd32d55a0a7e08384084d081557 (diff)
parent72183cb297f614dc2df1c0ed08afac1be27ec35a (diff)
downloadgit-f20408dadb75914460b9251b56fe4bffb5f44f48.tar.gz
git-f20408dadb75914460b9251b56fe4bffb5f44f48.tar.xz
Merge branch 'sg/maint-gitdir-in-subdir' into maint
* sg/maint-gitdir-in-subdir: Fix gitdir detection when in subdir of gitdir
Diffstat (limited to 't')
-rwxr-xr-xt/t1501-worktree.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index f6a6f839a..27dc6c55d 100755
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
@@ -92,6 +92,13 @@ cd sub/dir || exit 1
test_rev_parse 'in repo.git/sub/dir' false true true sub/dir/
cd ../../../.. || exit 1
+test_expect_success 'detecting gitdir when cwd is in a subdir of gitdir' '
+ (expected=$(pwd)/repo.git &&
+ cd repo.git/refs &&
+ unset GIT_DIR &&
+ test "$expected" = "$(git rev-parse --git-dir)")
+'
+
test_expect_success 'repo finds its work tree' '
(cd repo.git &&
: > work/sub/dir/untracked &&