Subject: Re: [PATCH v5 04/15] odb: move packfile map into `struct packfile_store`

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 23 Sep 2025 11:35:09 +0200

On Wed, Sep 17, 2025 at 05:15:44PM -0500, Justin Tobler wrote:
> On 25/09/15 10:54AM, Patrick Steinhardt wrote:
> > diff --git a/midx.c b/midx.c
> > index 7726c13d7e..e96970efbf 100644
> > --- a/midx.c
> > +++ b/midx.c
> > @@ -460,7 +460,7 @@ int prepare_midx_pack(struct multi_pack_index *m,
> >  	strbuf_addbuf(&key, &pack_name);
> >  	strbuf_strip_suffix(&key, ".idx");
> >  	strbuf_addstr(&key, ".pack");
> > -	p = hashmap_get_entry_from_hash(&r->objects->pack_map,
> > +	p = hashmap_get_entry_from_hash(&r->objects->packfiles->map,
> >  					strhash(key.buf), key.buf,
> >  					struct packed_git, packmap_ent);
> 
> In `struct object_database`, the comment above the defined `struct
> packfile_store *packfiles` says it "should only be accessed directly by
> packfile.c". Now that the packfile map has been moved into `struct
> packfile_store`, it looks like "midx.c" now reaches into this structure.
> 
> Is this something we should consider?

Hm, probably I guess. I think overall the comment doesn't add that much
value anymore now that things are a bit more self-contained, but let's
keep it for now and update it accordingly.

Eventually, it will be dropped anyway as we move the data structures
into the object source backend, as it becomes obvious that this is
private data at that point.

Patrick