diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-23 16:08:28 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-23 08:15:19 -0700 |
| commit | 627d08cca769999a7a9419b8aeaba26f61f551f5 (patch) | |
| tree | 0abdd07b61d7f6aaaef5acf8cb552b958e6f04b9 /builtin/submodule--helper.c | |
| parent | config: drop `git_config_get_string_multi()` wrapper (diff) | |
| download | git-627d08cca769999a7a9419b8aeaba26f61f551f5.tar.gz git-627d08cca769999a7a9419b8aeaba26f61f551f5.zip | |
config: drop `git_config_get_string()` wrapper
In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.
Follow through with that intent and remove `git_config_get_string()`.
All callsites are adjusted so that they use
`repo_config_get_string(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.
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 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 6bcc741a6a..18aa69f0ca 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -53,7 +53,7 @@ static char *resolve_relative_url(const char *rel_url, const char *up_path, int struct strbuf remotesb = STRBUF_INIT; strbuf_addf(&remotesb, "remote.%s.url", remote); - if (git_config_get_string(remotesb.buf, &remoteurl)) { + if (repo_config_get_string(the_repository, remotesb.buf, &remoteurl)) { if (!quiet) warning(_("could not look up configuration '%s'. " "Assuming this repository is its own " @@ -468,7 +468,7 @@ static void init_submodule(const char *path, const char *prefix, * .gitmodules, so look it up directly. */ strbuf_addf(&sb, "submodule.%s.url", sub->name); - if (git_config_get_string(sb.buf, &url)) { + if (repo_config_get_string(the_repository, sb.buf, &url)) { if (!sub->url) die(_("No url found for submodule path '%s' in .gitmodules"), displaypath); @@ -1623,11 +1623,11 @@ static void prepare_possible_alternates(const char *sm_name, char *sm_alternate = NULL, *error_strategy = NULL; struct submodule_alternate_setup sas = SUBMODULE_ALTERNATE_SETUP_INIT; - git_config_get_string("submodule.alternateLocation", &sm_alternate); + repo_config_get_string(the_repository, "submodule.alternateLocation", &sm_alternate); if (!sm_alternate) return; - git_config_get_string("submodule.alternateErrorStrategy", &error_strategy); + repo_config_get_string(the_repository, "submodule.alternateErrorStrategy", &error_strategy); if (!error_strategy) error_strategy = xstrdup("die"); @@ -1808,11 +1808,11 @@ static int clone_submodule(const struct module_clone_data *clone_data, die(_("could not get submodule directory for '%s'"), clone_data_path); /* setup alternateLocation and alternateErrorStrategy in the cloned submodule if needed */ - git_config_get_string("submodule.alternateLocation", &sm_alternate); + repo_config_get_string(the_repository, "submodule.alternateLocation", &sm_alternate); if (sm_alternate) git_config_set_in_file(p, "submodule.alternateLocation", sm_alternate); - git_config_get_string("submodule.alternateErrorStrategy", &error_strategy); + repo_config_get_string(the_repository, "submodule.alternateErrorStrategy", &error_strategy); if (error_strategy) git_config_set_in_file(p, "submodule.alternateErrorStrategy", error_strategy); |
