summaryrefslogtreecommitdiff
path: root/t/t1501-worktree.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t1501-worktree.sh')
-rwxr-xr-xt/t1501-worktree.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index c039ee3fd8..27dc6c55d5 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 &&
@@ -171,7 +178,7 @@ test_expect_success 'git diff' '
test_expect_success 'git grep' '
(cd repo.git/work/sub &&
- GIT_DIR=../.. GIT_WORK_TREE=.. git grep -l changed | grep -q dir/tracked)
+ GIT_DIR=../.. GIT_WORK_TREE=.. git grep -l changed | grep dir/tracked)
'
test_done