Skip to content

Commit cf9cd8b

Browse files
derrickstoleegitster
authored andcommitted
fsck: use local repository
In 0d30fee (fsck: create scaffolding for rev-index checks, 2023-04-17) and later 5a6072f (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 756f1bc commit cf9cd8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/fsck.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,20 +869,20 @@ static int check_pack_rev_indexes(struct repository *r, int show_progress)
869869
int res = 0;
870870

871871
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)
873873
pack_count++;
874874
progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count);
875875
pack_count = 0;
876876
}
877877

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) {
879879
int load_error = load_pack_revindex_from_disk(p);
880880

881881
if (load_error < 0) {
882882
error(_("unable to load rev-index for pack '%s'"), p->pack_name);
883883
res = ERROR_PACK_REV_INDEX;
884884
} else if (!load_error &&
885-
!load_pack_revindex(the_repository, p) &&
885+
!load_pack_revindex(r, p) &&
886886
verify_pack_revindex(p)) {
887887
error(_("invalid rev-index for pack '%s'"), p->pack_name);
888888
res = ERROR_PACK_REV_INDEX;

0 commit comments

Comments
 (0)