]> Kevux Git Server - rit/commit
packfile: introduce function to iterate through objects
authorPatrick Steinhardt <ps@pks.im>
Mon, 26 Jan 2026 09:51:22 +0000 (10:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Jan 2026 16:26:07 +0000 (08:26 -0800)
commit736464b84f4439361ec10e9ef49bff674fea952d
tree362fb7eb8b1bca5761da4309f87717a46410d4f9
parent37353119046414b2dccb26b32cb5224e0c9258e1
packfile: introduce function to iterate through objects

Introduce a new function `packfile_store_for_each_object()`. This
function is equivalent to `odb_source_loose_for_each_object()`, except
that it:

  - Works on a single packfile store instead of working on the object
    database level. Consequently, it will only yield packed objects of a
    single object database source.

  - Passes a `struct object_info` to the callback function.

As such, it provides the same callback interface as we already provide
for loose objects now. These functions will be used in a subsequent step
to implement `odb_for_each_object()`.

The `for_each_packed_object()` function continues to exist for now, but
it will be removed at the end of this patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.c
packfile.h