]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5319: change invalid offset for SHA-256 compatibility
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 21 Dec 2019 19:49:25 +0000 (19:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jan 2020 22:06:19 +0000 (14:06 -0800)
When using SHA-1, the existing value of the byte we use is 0x13, so
writing the byte 0x07 serves to corrupt the test and verify that we
detect corruption.  However, when we use SHA-256, the value at that
offset is already 0x07, so our "corruption" doesn't work and the test
fails to detect it.

To provide a value that is truly out of range, let's use 0xff, which is
not likely to be a valid value as the high byte of a two-byte offset in
a multi-pack index this small.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5319-multi-pack-index.sh

index cd2f87be6afe241a35e7c3b20fac09d10908f633..464bb68e89b7a5b1956970e61b72051d3c2f5447 100755 (executable)
@@ -304,12 +304,12 @@ test_expect_success 'verify incorrect pack-int-id' '
 '
 
 test_expect_success 'verify incorrect offset' '
-       corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\07" $objdir \
+       corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \
                "incorrect object offset"
 '
 
 test_expect_success 'git-fsck incorrect offset' '
-       corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\07" $objdir \
+       corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \
                "incorrect object offset" \
                "git -c core.multipackindex=true fsck"
 '