aboutsummaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-01-15 05:50:16 -0800
committerJunio C Hamano <gitster@pobox.com>2026-01-15 05:50:16 -0800
commitec16dde5c8c08fe6f26a2183a038e02ea7b2b25f (patch)
treefef31f79ec514c9429614e2518ea48874f2d0801 /midx.c
parentc8e1706e8dbe7a511c1fd85d5147a1722b4080f1 (diff)
parenta282a8f163fa70f9eacc880e6188141cef917058 (diff)
downloadgit-ec16dde5c8c08fe6f26a2183a038e02ea7b2b25f.tar.xz
Merge branch 'ps/packfile-store-in-odb-source' into ps/odb-for-each-object
* ps/packfile-store-in-odb-source: packfile: move MIDX into packfile store packfile: refactor `find_pack_entry()` to work on the packfile store packfile: inline `find_kept_pack_entry()` packfile: only prepare owning store in `packfile_store_prepare()` packfile: only prepare owning store in `packfile_store_get_packs()` packfile: move packfile store into object source packfile: refactor misleading code when unusing pack windows packfile: refactor kept-pack cache to work with packfile stores packfile: pass source to `prepare_pack()` packfile: create store via its owning source odb: properly close sources before freeing them builtin/gc: fix condition for whether to write commit graphs
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/midx.c b/midx.c
index b681b18fc1..a75ea99a0d 100644
--- a/midx.c
+++ b/midx.c
@@ -95,8 +95,8 @@ static int midx_read_object_offsets(const unsigned char *chunk_start,
struct multi_pack_index *get_multi_pack_index(struct odb_source *source)
{
- packfile_store_prepare(source->odb->packfiles);
- return source->midx;
+ packfile_store_prepare(source->packfiles);
+ return source->packfiles->midx;
}
static struct multi_pack_index *load_multi_pack_index_one(struct odb_source *source,
@@ -447,7 +447,6 @@ static uint32_t midx_for_pack(struct multi_pack_index **_m,
int prepare_midx_pack(struct multi_pack_index *m,
uint32_t pack_int_id)
{
- struct repository *r = m->source->odb->repo;
struct strbuf pack_name = STRBUF_INIT;
struct packed_git *p;
@@ -460,7 +459,7 @@ int prepare_midx_pack(struct multi_pack_index *m,
strbuf_addf(&pack_name, "%s/pack/%s", m->source->path,
m->pack_names[pack_int_id]);
- p = packfile_store_load_pack(r->objects->packfiles,
+ p = packfile_store_load_pack(m->source->packfiles,
pack_name.buf, m->source->local);
strbuf_release(&pack_name);
@@ -710,12 +709,12 @@ int prepare_multi_pack_index_one(struct odb_source *source)
if (!r->settings.core_multi_pack_index)
return 0;
- if (source->midx)
+ if (source->packfiles->midx)
return 1;
- source->midx = load_multi_pack_index(source);
+ source->packfiles->midx = load_multi_pack_index(source);
- return !!source->midx;
+ return !!source->packfiles->midx;
}
int midx_checksum_valid(struct multi_pack_index *m)
@@ -804,9 +803,9 @@ void clear_midx_file(struct repository *r)
struct odb_source *source;
for (source = r->objects->sources; source; source = source->next) {
- if (source->midx)
- close_midx(source->midx);
- source->midx = NULL;
+ if (source->packfiles->midx)
+ close_midx(source->packfiles->midx);
+ source->packfiles->midx = NULL;
}
}