]> Kevux Git Server - rit/commit
object-name: move logic to iterate through loose prefixed objects
authorPatrick Steinhardt <ps@pks.im>
Fri, 20 Mar 2026 07:07:30 +0000 (08:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Mar 2026 20:16:42 +0000 (13:16 -0700)
commit284b7862be735bb47276ac288ace153ae3d06938
tree884e93b77a757e03ed237a1d3fde640cb1eeb8e8
parentcfd575f0a9730712107e4ee6799a37665bcd8204
object-name: move logic to iterate through loose prefixed objects

The logic to iterate through loose objects that have a certain prefix is
currently hosted in "object-name.c". This logic reaches into specifics
of the loose object source, so it breaks once a different backend is
used for the object storage.

Move the logic to iterate through loose objects with a prefix into
"object-file.c". This is done by extending the for-each-object options
to support an optional prefix that is then honored by the loose source.
Naturally, we'll also have this support in the packfile store. This is
done in the next commit.

Furthermore, there are no users of the loose cache outside of
"object-file.c" anymore. As such, convert `odb_source_loose_cache()` to
have file scope.

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