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 | |
| 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')
| -rw-r--r-- | builtin/gc.c | 4 | ||||
| -rw-r--r-- | builtin/log.c | 2 | ||||
| -rw-r--r-- | builtin/notes.c | 2 | ||||
| -rw-r--r-- | builtin/submodule--helper.c | 12 |
4 files changed, 10 insertions, 10 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index f395cc57a1..d8f7a1858c 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -218,12 +218,12 @@ static void gc_config(struct gc_config *cfg) if (!git_config_get_ulong("core.deltabasecachelimit", &ulongval)) cfg->delta_base_cache_limit = ulongval; - if (!git_config_get_string("gc.repackfilter", &owned)) { + if (!repo_config_get_string(the_repository, "gc.repackfilter", &owned)) { free(cfg->repack_filter); cfg->repack_filter = owned; } - if (!git_config_get_string("gc.repackfilterto", &owned)) { + if (!repo_config_get_string(the_repository, "gc.repackfilterto", &owned)) { free(cfg->repack_filter_to); cfg->repack_filter_to = owned; } diff --git a/builtin/log.c b/builtin/log.c index b512f12e80..a9969ad00a 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -235,7 +235,7 @@ static void set_default_decoration_filter(struct decoration_filter *decoration_f * since the command-line takes precedent. */ if (use_default_decoration_filter && - !git_config_get_string("log.initialdecorationset", &value) && + !repo_config_get_string(the_repository, "log.initialdecorationset", &value) && !strcmp("all", value)) use_default_decoration_filter = 0; free(value); diff --git a/builtin/notes.c b/builtin/notes.c index 17004cdb10..d2252cf534 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -873,7 +873,7 @@ static int git_config_get_notes_strategy(const char *key, { char *value; - if (git_config_get_string(key, &value)) + if (repo_config_get_string(the_repository, key, &value)) return 1; if (parse_notes_merge_strategy(value, strategy)) git_die_config(the_repository, key, _("unknown notes merge strategy %s"), value); 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); |
