diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-04-17 18:21:38 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-17 23:39:04 +0200 |
commit | 0d30feef3c55f63f8db1dc1e52071090d16dfaaf (patch) | |
tree | e5420913efcb4b5b70d9332b3923804601b55927 /t/t5325-reverse-index.sh | |
parent | Merge branch 'tb/pack-revindex-on-disk' into ds/fsck-pack-revindex (diff) | |
download | git-0d30feef3c55f63f8db1dc1e52071090d16dfaaf.tar.xz git-0d30feef3c55f63f8db1dc1e52071090d16dfaaf.zip |
fsck: create scaffolding for rev-index checks
The 'fsck' builtin checks many of Git's on-disk data structures, but
does not currently validate the pack rev-index files (a .rev file to
pair with a .pack and .idx file).
Before doing a more-involved check process, create the scaffolding
within builtin/fsck.c to have a new error type and add that error type
when the API method verify_pack_revindex() returns an error. That method
does nothing currently, but we will add checks to it in later changes.
For now, check that 'git fsck' succeeds without any errors in the normal
case. Future checks will be paired with tests that corrupt the .rev file
appropriately.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-x | t/t5325-reverse-index.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5325-reverse-index.sh b/t/t5325-reverse-index.sh index 0548fce1aa..206c412f50 100755 --- a/t/t5325-reverse-index.sh +++ b/t/t5325-reverse-index.sh @@ -131,4 +131,18 @@ test_expect_success 'revindex in-memory vs on-disk' ' test_cmp on-disk in-core ) ' + +test_expect_success 'fsck succeeds on good rev-index' ' + test_when_finished rm -fr repo && + git init repo && + ( + cd repo && + + test_commit commit && + git -c pack.writeReverseIndex=true repack -ad && + git fsck 2>err && + test_must_be_empty err + ) +' + test_done |