odb: get rid of the_repository in for_each() functions

There are a couple of iterator-style functions that execute a callback
for each instance of a given set, all of which currently depend on
`the_repository`. Refactor them to instead take an object database as
parameter so that we can get rid of this dependency.

Rename the functions accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-07-01 14:22:21 +02:00
committed by Junio C Hamano
parent c44185f6c1
commit 798c661ce3
8 changed files with 47 additions and 28 deletions

View File

@@ -115,7 +115,8 @@ static void for_each_cached_alternate(struct fetch_negotiator *negotiator,
size_t i;
if (!initialized) {
for_each_alternate_ref(cache_one_alternate, &cache);
odb_for_each_alternate_ref(the_repository->objects,
cache_one_alternate, &cache);
initialized = 1;
}