diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-05-15 13:59:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-15 13:59:04 -0700 |
commit | cd2b740ca95291b81b8e75000d2ee76b4f735877 (patch) | |
tree | 31bf2437d5454699cdd86e325046e95a476b5ccd /builtin | |
parent | 29b8a3f49d3c521431650b670fa2fbcd9ad571b3 (diff) | |
parent | cf9cd8b55c55794cc5eb38a157855f1ca2edd5ab (diff) | |
download | git-cd2b740ca95291b81b8e75000d2ee76b4f735877.tar.gz |
Merge branch 'ds/fsck-bitmap'
"git fsck" learned to detect bit-flip breakages in the reachability
bitmap files.
* ds/fsck-bitmap:
fsck: use local repository
fsck: verify checksums of all .bitmap files
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fsck.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c index 2cd461b84c..dcc165bf0c 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -27,6 +27,7 @@ #include "run-command.h" #include "worktree.h" #include "pack-revindex.h" +#include "pack-bitmap.h" #define REACHABLE 0x0001 #define SEEN 0x0002 @@ -57,6 +58,7 @@ static int name_objects; #define ERROR_COMMIT_GRAPH 020 #define ERROR_MULTI_PACK_INDEX 040 #define ERROR_PACK_REV_INDEX 0100 +#define ERROR_BITMAP 0200 static const char *describe_object(const struct object_id *oid) { @@ -867,20 +869,20 @@ static int check_pack_rev_indexes(struct repository *r, int show_progress) int res = 0; if (show_progress) { - for (struct packed_git *p = get_all_packs(the_repository); p; p = p->next) + for (struct packed_git *p = get_all_packs(r); p; p = p->next) pack_count++; progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count); pack_count = 0; } - for (struct packed_git *p = get_all_packs(the_repository); p; p = p->next) { + for (struct packed_git *p = get_all_packs(r); p; p = p->next) { int load_error = load_pack_revindex_from_disk(p); if (load_error < 0) { error(_("unable to load rev-index for pack '%s'"), p->pack_name); res = ERROR_PACK_REV_INDEX; } else if (!load_error && - !load_pack_revindex(the_repository, p) && + !load_pack_revindex(r, p) && verify_pack_revindex(p)) { error(_("invalid rev-index for pack '%s'"), p->pack_name); res = ERROR_PACK_REV_INDEX; @@ -1056,6 +1058,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) } errors_found |= check_pack_rev_indexes(the_repository, show_progress); + if (verify_bitmap_files(the_repository)) + errors_found |= ERROR_BITMAP; check_connectivity(); |