fsck: use local repository

In 0d30feef3c5 (fsck: create scaffolding for rev-index checks, 2023-04-17) and later 5a6072f631d (fsck: validate .rev file header, 2023-04-17), the check_pack_rev_indexes() method was created with a 'struct repository *r' parameter. However, this parameter was unused and instead 'the_repository' was used in its place. Fix this situation with the obvious replacement. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed May 2, 2023 at 13:27 UTC cf9cd8b55c55794cc5eb38a157855f1ca2edd5ab
1 file changed +3 -3
builtin/fsck.c
+3 -3
@@ -869,20 +869,20 @@ static int check_pack_rev_indexes(struct repository *r, int show_progress)
869 int res = 0;
870
871 if (show_progress) {
872 - for (struct packed_git *p = get_all_packs(the_repository); p; p = p->next)
872 + for (struct packed_git *p = get_all_packs(r); p; p = p->next)
873 pack_count++;
874 progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count);
875 pack_count = 0;
876 }
877
878 - for (struct packed_git *p = get_all_packs(the_repository); p; p = p->next) {
878 + for (struct packed_git *p = get_all_packs(r); p; p = p->next) {
879 int load_error = load_pack_revindex_from_disk(p);
880
881 if (load_error < 0) {
882 error(_("unable to load rev-index for pack '%s'"), p->pack_name);
883 res = ERROR_PACK_REV_INDEX;
884 } else if (!load_error &&
885 - !load_pack_revindex(the_repository, p) &&
885 + !load_pack_revindex(r, p) &&
886 verify_pack_revindex(p)) {
887 error(_("invalid rev-index for pack '%s'"), p->pack_name);
888 res = ERROR_PACK_REV_INDEX;