Skip to content

Commit 12d0464

Browse files
pks-tgitster
authored andcommitted
packfile: only prepare owning store in packfile_store_get_packs()
When calling `packfile_store_get_packs()` we prepare not only the provided packfile store, but also all those of all other sources part of teh same object database. This was required when the store was still sitting on the object database level. But now that it sits on the source level it's not anymore. Adapt the code so that we only prepare the MIDX of the provided store. All callers only work in the context of a single store or call the function in a loop over all sources, so this change shouldn't have any practical effects. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1d05db2 commit 12d0464

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packfile.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,10 +1092,8 @@ struct packfile_list_entry *packfile_store_get_packs(struct packfile_store *stor
10921092
{
10931093
packfile_store_prepare(store);
10941094

1095-
for (struct odb_source *source = store->source->odb->sources; source; source = source->next) {
1096-
struct multi_pack_index *m = source->midx;
1097-
if (!m)
1098-
continue;
1095+
if (store->source->midx) {
1096+
struct multi_pack_index *m = store->source->midx;
10991097
for (uint32_t i = 0; i < m->num_packs + m->num_packs_in_base; i++)
11001098
prepare_midx_pack(m, i);
11011099
}

0 commit comments

Comments
 (0)