diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-09-13 08:17:32 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-14 00:15:24 +0300 |
commit | cdd1e17f87105dcb828f3e79cec14fcdc5073e46 (patch) | |
tree | 110d04409d5a0f2a61284944001bb2afae424b34 /t/t0000-basic.sh | |
parent | 2c02b110da641fed514c2939d678508ea16051ac (diff) |
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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-x | t/t0000-basic.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index b94221b951..a9dc534048 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -1015,12 +1015,13 @@ test_expect_success SHA1 'validate object ID for a known tree' ' test_expect_success 'put invalid objects into the index' ' rm -f .git/index && - cat >badobjects <<-\EOF && - 100644 blob 1000000000000000000000000000000000000000 dir/file1 - 100644 blob 2000000000000000000000000000000000000000 dir/file2 - 100644 blob 3000000000000000000000000000000000000000 dir/file3 - 100644 blob 4000000000000000000000000000000000000000 dir/file4 - 100644 blob 5000000000000000000000000000000000000000 dir/file5 + suffix=$(echo $ZERO_OID | sed -e "s/^.//") && + cat >badobjects <<-EOF && + 100644 blob $(test_oid 001) dir/file1 + 100644 blob $(test_oid 002) dir/file2 + 100644 blob $(test_oid 003) dir/file3 + 100644 blob $(test_oid 004) dir/file4 + 100644 blob $(test_oid 005) dir/file5 EOF git update-index --index-info <badobjects ' |