t4054: make hash-size independent

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>
This commit is contained in:
brian m. carlson 2019-12-21 19:49:17 +00:00 коммит произвёл Junio C Hamano
Родитель c58ae96fc4
Коммит 194264c185
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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
)