]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4054: make hash-size independent
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 21 Dec 2019 19:49:17 +0000 (19:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jan 2020 22:06:18 +0000 (14:06 -0800)
Instead of hard-coding the length of an object ID when creating a tree,
generate it based on $ZERO_OID.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4054-diff-bogus-tree.sh

index fcae82fffa7f74a65fc6b475cc5c3eeefda3029a..8c95f152b23b242df5f5aaa0b5b25e6e1826f753 100755 (executable)
@@ -4,8 +4,9 @@ test_description='test diff with a bogus tree containing the null sha1'
 . ./test-lib.sh
 
 test_expect_success 'create bogus tree' '
+       name=$(echo $ZERO_OID | sed -e "s/00/Q/g") &&
        bogus_tree=$(
-               printf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" |
+               printf "100644 fooQ$name" |
                q_to_nul |
                git hash-object -w --stdin -t tree
        )