Skip to content

Commit cdd1e17

Browse files
bk2204gitster
authored andcommitted
t0000: use hash translation table
If the hash we're using is 32 bytes in size, attempting to insert a 20-byte object name won't work. Since these are synthesized objects that are almost all zeros, look them up in a translation table. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c02b11 commit cdd1e17

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

t/t0000-basic.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,13 @@ test_expect_success SHA1 'validate object ID for a known tree' '
10151015

10161016
test_expect_success 'put invalid objects into the index' '
10171017
rm -f .git/index &&
1018-
cat >badobjects <<-\EOF &&
1019-
100644 blob 1000000000000000000000000000000000000000 dir/file1
1020-
100644 blob 2000000000000000000000000000000000000000 dir/file2
1021-
100644 blob 3000000000000000000000000000000000000000 dir/file3
1022-
100644 blob 4000000000000000000000000000000000000000 dir/file4
1023-
100644 blob 5000000000000000000000000000000000000000 dir/file5
1018+
suffix=$(echo $ZERO_OID | sed -e "s/^.//") &&
1019+
cat >badobjects <<-EOF &&
1020+
100644 blob $(test_oid 001) dir/file1
1021+
100644 blob $(test_oid 002) dir/file2
1022+
100644 blob $(test_oid 003) dir/file3
1023+
100644 blob $(test_oid 004) dir/file4
1024+
100644 blob $(test_oid 005) dir/file5
10241025
EOF
10251026
git update-index --index-info <badobjects
10261027
'

0 commit comments

Comments
 (0)