Re: [PATCH v2 11/17] odb/source-packed: wire up `for_each_object()` callback
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jun 16, 2026, 22:10 UTC
- Message-ID
- <ajHIjrQJvWtbCrZp@denethor>
- In-Reply-To
- <20260609-pks-odb-source-packed-v2-11-839089132c8b@pks.im>
On 26/06/09 10:51AM, Patrick Steinhardt wrote:
Show 6 quoted lines
> Move `packfile_store_for_each_object()` and its associated helpers from > "packfile.c" into "odb/source-packed.c" and wire it up as the > `for_each_object()` callback of the "packed" source. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > ---
[snip]
Show 5 quoted lines
> @@ -291,6 +548,7 @@ struct odb_source_packed *odb_source_packed_new(struct odb_source_files *parent) > packed->base.reprepare = odb_source_packed_reprepare; > packed->base.read_object_info = odb_source_packed_read_object_info; > packed->base.read_object_stream = odb_source_packed_read_object_stream; > + packed->base.for_each_object = odb_source_packed_for_each_object;
Wiring up the callback. Looks good.
Show 14 quoted lines
> if (!is_absolute_path(parent->base.path)) > chdir_notify_register(NULL, odb_source_packed_reparent, packed); > diff --git a/packfile.c b/packfile.c > index 42c84397eb..b8d6054c16 100644 > --- a/packfile.c > +++ b/packfile.c > @@ -1362,8 +1362,8 @@ static void add_delta_base_cache(struct packed_git *p, off_t base_offset, > hashmap_add(&delta_base_cache, &ent->ent); > } > > -static int packed_object_info_with_index_pos(struct packed_git *p, off_t obj_offset, > - uint32_t *maybe_index_pos, struct object_info *oi) > +int packed_object_info_with_index_pos(struct packed_git *p, off_t obj_offset, > + uint32_t *maybe_index_pos, struct object_info *oi)
Looks like we are also exposing `packed_object_info_with_index_pos()` now. Not sure yet if this is also intended to be temporary like `find_pack_entry()` in a previous patch though though.
-Justin