t3103: abstract away SHA-1-specific constants
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 13 May 2018 02:24:22 +0000 (02:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 May 2018 02:02:01 +0000 (11:02 +0900)
Adjust the test so that it uses variables and command substitution for
trees instead of hard-coded hashes. This also has the benefit of making
it more obvious how the test works.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3103-ls-tree-misc.sh
index 09dcf043fdff1495dc4e0d1e56b9118c4f5feaeb..14520913afca8d1c980e4cd58d0b943a1a498611 100755 (executable)
@@ -17,7 +17,8 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '
-       rm -f .git/objects/5f/cffbd6e4c5c5b8d81f5e9314b20e338e3ffff5 &&
+       tree=$(git rev-parse HEAD:a) &&
+       rm -f .git/objects/$(echo $tree | sed -e "s,^\(..\),\1/,") &&
        test_must_fail git ls-tree -r HEAD
 '