aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-01 14:22:21 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:46:36 -0700
commit798c661ce39f7d5297fa7ea8928ae464b6d5dd95 (patch)
treed3e3e7263db4180d4b71ce7fd87b76a1e0004119 /fetch-pack.c
parentodb: get rid of `the_repository` when handling alternates (diff)
downloadgit-798c661ce39f7d5297fa7ea8928ae464b6d5dd95.tar.gz
git-798c661ce39f7d5297fa7ea8928ae464b6d5dd95.zip
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>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index cf157f5d7e..47fa7fa4c4 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -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;
}