diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-04-17 19:21:40 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-18 00:39:04 +0300 |
commit | 5f658d1b577722111564f51962d6af33d1fe96c6 (patch) | |
tree | 013eb66125406727024d481aaf33511055356ec1 /t | |
parent | d975fe1fa57d57cfd21a97f96f4a94b99f50f2f4 (diff) |
fsck: check rev-index position values
When checking a rev-index file, it may be helpful to identify exactly
which positions are incorrect. Compare the rev-index to a
freshly-computed in-memory rev-index and report the comparison failures.
This additional check (on top of the checksum validation) can help find
files that were corrupt by a single bit flip on-disk or perhaps were
written incorrectly due to a bug in Git.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5325-reverse-index.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t5325-reverse-index.sh b/t/t5325-reverse-index.sh index 6b7c709a1f..5c3c80f88f 100755 --- a/t/t5325-reverse-index.sh +++ b/t/t5325-reverse-index.sh @@ -185,4 +185,9 @@ test_expect_success 'fsck catches invalid checksum' ' "invalid checksum" ' +test_expect_success 'fsck catches invalid row position' ' + corrupt_rev_and_verify 14 "\07" \ + "invalid rev-index position" +' + test_done |