summaryrefslogtreecommitdiff
path: root/t/t1500-rev-parse.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2009-02-14 16:16:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-15 05:29:46 (GMT)
commit8fb3c00d2ea4dad96fe977f8983ba0376e0c4986 (patch)
treef18414d7f7794cac50a4ade3d6f62151cc2d6f67 /t/t1500-rev-parse.sh
parentd0268de6d755c72ff375ec95a0cc0dbd99dc31e2 (diff)
downloadgit-8fb3c00d2ea4dad96fe977f8983ba0376e0c4986.zip
git-8fb3c00d2ea4dad96fe977f8983ba0376e0c4986.tar.gz
git-8fb3c00d2ea4dad96fe977f8983ba0376e0c4986.tar.bz2
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>
Diffstat (limited to 't/t1500-rev-parse.sh')
-rwxr-xr-xt/t1500-rev-parse.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 85da4ca..186792e 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -26,16 +26,23 @@ test_rev_parse() {
"test '$1' = \"\$(git rev-parse --show-prefix)\""
shift
[ $# -eq 0 ] && return
+
+ test_expect_success "$name: git-dir" \
+ "test '$1' = \"\$(git rev-parse --git-dir)\""
+ shift
+ [ $# -eq 0 ] && return
}
-# label is-bare is-inside-git is-inside-work prefix
+# label is-bare is-inside-git is-inside-work prefix git-dir
+
+ROOT=$(pwd)
test_rev_parse toplevel false false true ''
cd .git || exit 1
test_rev_parse .git/ false true false ''
cd objects || exit 1
-test_rev_parse .git/objects/ false true false ''
+test_rev_parse .git/objects/ false true false '' "$ROOT/.git"
cd ../.. || exit 1
mkdir -p sub/dir || exit 1