Re: [PATCH v2 05/17] odb/source-packed: start converting to a proper `struct odb_source`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 17, 2026, 07:26 UTC
- Message-ID
- <ajJMHcHdtFdHjD8v@pks.im>
- In-Reply-To
- <ajG-rP7cRjZa3zJE@denethor>
On Tue, Jun 16, 2026 at 04:36:59PM -0500, Justin Tobler wrote:
Show 23 quoted lines
> On 26/06/09 10:50AM, Patrick Steinhardt wrote:
> > struct odb_source_packed *odb_source_packed_new(struct odb_source_files *parent)
> > {
> > - struct odb_source_packed *store;
> > - CALLOC_ARRAY(store, 1);
> > - store->files = parent;
> > - strmap_init(&store->packs_by_path);
> > - return store;
> > + struct odb_source_packed *packed;
> > +
> > + CALLOC_ARRAY(packed, 1);
> > + odb_source_init(&packed->base, parent->base.odb, ODB_SOURCE_PACKED,
> > + parent->base.path, parent->base.local);
> > + packed->files = parent;
> > + strmap_init(&packed->packs_by_path);
> > +
> > + packed->base.free = odb_source_packed_free;
> > +
> > + if (!is_absolute_path(parent->base.path))
> > + chdir_notify_register(NULL, odb_source_packed_reparent, packed);
>
> Out of curiousity, did the packfile store previously not have to worry
> about changing directories?No, it didn't, and at this step here it still doesn't. This is mostly because we still use the path of the "files" source, and that source handles the reparenting for us. But it will be needed in a subsequent step once we get rid of the pointer to the owning "files" source.
Patrick