diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-01 14:22:21 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-01 14:46:36 -0700 |
| commit | 798c661ce39f7d5297fa7ea8928ae464b6d5dd95 (patch) | |
| tree | d3e3e7263db4180d4b71ce7fd87b76a1e0004119 /builtin/submodule--helper.c | |
| parent | odb: get rid of `the_repository` when handling alternates (diff) | |
| download | git-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 'builtin/submodule--helper.c')
| -rw-r--r-- | builtin/submodule--helper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 84f7fa5342..7ca483cab5 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1668,7 +1668,8 @@ static void prepare_possible_alternates(const char *sm_name, die(_("Value '%s' for submodule.alternateErrorStrategy is not recognized"), error_strategy); if (!strcmp(sm_alternate, "superproject")) - foreach_alt_odb(add_possible_reference_from_superproject, &sas); + odb_for_each_alternate(the_repository->objects, + add_possible_reference_from_superproject, &sas); else if (!strcmp(sm_alternate, "no")) ; /* do nothing */ else |
