Move 'rev-parse --git-dir' test to t1500
Commit 72183cb2 (Fix gitdir detection when in subdir of gitdir, 2009-01-16) added a test to 't1501-worktree' to check the behaviour of 'git rev-parse --git-dir' in a special case. However, t1501 is about testing separate work tree setups, and not about basic 'rev-parse' functionality, which is tested in t1500-rev-parse. Therefore, this patch moves that test to t1500. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor committed
Feb 14, 2009 at 17:16 UTC
8fb3c00d2ea4dad96fe977f8983ba0376e0c4986
2 files changed
+9
-9
t/t1500-rev-parse.sh
+9
-2
@@ -26,16 +26,23 @@ test_rev_parse() {
26
"test '$1' = \"\$(git rev-parse --show-prefix)\""
27
shift
28
[ $# -eq 0 ] && return
29
+
30
+ test_expect_success "$name: git-dir" \
31
+ "test '$1' = \"\$(git rev-parse --git-dir)\""
32
+ shift
33
+ [ $# -eq 0 ] && return
34
}
35
31
-# label is-bare is-inside-git is-inside-work prefix
36
+# label is-bare is-inside-git is-inside-work prefix git-dir
37
+
38
+ROOT=$(pwd)
39
40
test_rev_parse toplevel false false true ''
41
42
cd .git || exit 1
43
test_rev_parse .git/ false true false ''
44
cd objects || exit 1
38
-test_rev_parse .git/objects/ false true false ''
45
+test_rev_parse .git/objects/ false true false '' "$ROOT/.git"
46
cd ../.. || exit 1
47
48
mkdir -p sub/dir || exit 1
t/t1501-worktree.sh
-7
@@ -92,13 +92,6 @@ cd sub/dir || exit 1
92
test_rev_parse 'in repo.git/sub/dir' false true true sub/dir/
93
cd ../../../.. || exit 1
94
95
-test_expect_success 'detecting gitdir when cwd is in a subdir of gitdir' '
96
- (expected=$(pwd)/repo.git &&
97
- cd repo.git/refs &&
98
- unset GIT_DIR &&
99
- test "$expected" = "$(git rev-parse --git-dir)")
100
-'
101
-
95
test_expect_success 'repo finds its work tree' '
96
(cd repo.git &&
97
: > work/sub/dir/untracked &&