]> git.99rst.org Git - git.git/commit
connected: search promisor objects generically
authorPatrick Steinhardt <redacted>
Thu, 25 Jun 2026 09:57:42 +0000 (11:57 +0200)
committerJunio C Hamano <redacted>
Thu, 25 Jun 2026 20:20:20 +0000 (13:20 -0700)
commit66ee9cb93086b27721a36e2ba877921dcf177d91
treed14acf8ec9a9b59df084af33467b799067efc14a
parent0a7f3389f4c16da05a1113ef0829a352af62dcbe
connected: search promisor objects generically

When performing connectivity checks we have to figure out whether any of
the new objects are promisor objects, as we cannot assume full
connectivity if so.

This check is performed by iterating through all packfiles in the
repository and searching each of them for the given object. Of course,
this mechanism is quite specific to implementation details of the object
database, as we assume that it uses packfiles in the first place.

Refactor the logic so that we instead use `odb_for_each_object_ext()`
with an object prefix filter and the `ODB_FOR_EACH_OBJECT_PROMISOR_ONLY`
flag. This will yield all objects that have the exact object name and
that are part of a promisor pack in a generic way.

Add a test to verify that we indeed use the optimization.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
connected.c
t/t5616-partial-clone.sh
git clone https://git.99rst.org/PROJECT