]> git.ipfire.org Git - thirdparty/git.git/commit
object-file: read objects via the loose object source
authorPatrick Steinhardt <ps@pks.im>
Mon, 3 Nov 2025 07:42:04 +0000 (08:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Nov 2025 20:18:47 +0000 (12:18 -0800)
commitff7ad5cb3936514ec0be32531ff6274b53dbe091
treebff79ac15b2ebed9afa0d43c86818f89bc798b5b
parent376016ec71c3a6c883f2ca77a3f1c0245fd60dc2
object-file: read objects via the loose object source

When reading an object via `loose_object_info()` or `map_loose_object()`
we hand in the whole repository. We then iterate through each of the
object sources to figure out whether that source has the object in
question.

This logic is reversing responsibility though: a specific backend should
only care about one specific source, where the object sources themselves
are then managed by the object database.

Refactor the code accordingly by passing an object source to both of
these functions instead. The different sources are then handled by
either `do_oid_object_info_extended()`, which sits on the object
database level, and by `open_istream_loose()`. The latter function
arguably is still at the wrong level, but this will be cleaned up at a
later point in time.

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