diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-04-17 19:21:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-18 00:39:04 +0300 |
commit | 0d30feef3c55f63f8db1dc1e52071090d16dfaaf (patch) | |
tree | e5420913efcb4b5b70d9332b3923804601b55927 /pack-revindex.h | |
parent | 3c63503759136836dee84ea28835b1b4ef8882bf (diff) |
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 'pack-revindex.h')
-rw-r--r-- | pack-revindex.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pack-revindex.h b/pack-revindex.h index 46e834064e..c8861873b0 100644 --- a/pack-revindex.h +++ b/pack-revindex.h @@ -52,6 +52,14 @@ struct repository; int load_pack_revindex(struct repository *r, struct packed_git *p); /* + * verify_pack_revindex verifies that the on-disk rev-index for the given + * pack-file is the same that would be created if written from scratch. + * + * A negative number is returned on error. + */ +int verify_pack_revindex(struct packed_git *p); + +/* * load_midx_revindex loads the '.rev' file corresponding to the given * multi-pack index by mmap-ing it and assigning pointers in the * multi_pack_index to point at it. |