aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-23 16:08:29 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-23 08:15:19 -0700
commitcba3c02591b820fdb812cb2c2ebb5dbd98761ba8 (patch)
tree8b31a8e3469c1681015161a30587e5a83b1542d3 /builtin
parentconfig: drop `git_config_get_string()` wrapper (diff)
downloadgit-cba3c02591b820fdb812cb2c2ebb5dbd98761ba8.tar.gz
git-cba3c02591b820fdb812cb2c2ebb5dbd98761ba8.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/fetch.c2
-rw-r--r--builtin/gc.c4
-rw-r--r--builtin/remote.c2
-rw-r--r--builtin/submodule--helper.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index ea447c453d..52eae4b972 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2508,7 +2508,7 @@ int cmd_fetch(int argc,
if (!max_jobs)
max_jobs = online_cpus();
- if (!git_config_get_string_tmp("fetch.bundleuri", &bundle_uri) &&
+ if (!repo_config_get_string_tmp(the_repository, "fetch.bundleuri", &bundle_uri) &&
fetch_bundle_uri(the_repository, bundle_uri, NULL))
warning(_("failed to fetch bundles from '%s'"), bundle_uri);
diff --git a/builtin/gc.c b/builtin/gc.c
index d8f7a1858c..a2b8fbc9f3 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1765,7 +1765,7 @@ static void initialize_task_config(struct maintenance_run_opts *opts,
if (opts->schedule) {
strategy = none_strategy;
- if (!git_config_get_string_tmp("maintenance.strategy", &config_str)) {
+ if (!repo_config_get_string_tmp(the_repository, "maintenance.strategy", &config_str)) {
if (!strcasecmp(config_str, "incremental"))
strategy = incremental_strategy;
}
@@ -1788,7 +1788,7 @@ static void initialize_task_config(struct maintenance_run_opts *opts,
strbuf_reset(&config_name);
strbuf_addf(&config_name, "maintenance.%s.schedule",
tasks[i].name);
- if (!git_config_get_string_tmp(config_name.buf, &config_str))
+ if (!repo_config_get_string_tmp(the_repository, config_name.buf, &config_str))
strategy.tasks[i].schedule = parse_schedule(config_str);
if (strategy.tasks[i].schedule < opts->schedule)
continue;
diff --git a/builtin/remote.c b/builtin/remote.c
index ebd70bea3a..826b2dcfd0 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1268,7 +1268,7 @@ static int get_one_entry(struct remote *remote, void *priv)
strbuf_addf(&promisor_config, "remote.%s.partialclonefilter", remote->name);
strbuf_addf(&remote_info_buf, "%s (fetch)", remote->url.v[0]);
- if (!git_config_get_string_tmp(promisor_config.buf, &partial_clone_filter))
+ if (!repo_config_get_string_tmp(the_repository, promisor_config.buf, &partial_clone_filter))
strbuf_addf(&remote_info_buf, " [%s]", partial_clone_filter);
strbuf_release(&promisor_config);
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 18aa69f0ca..d2ab31835b 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -496,7 +496,7 @@ static void init_submodule(const char *path, const char *prefix,
/* Copy "update" setting when it is not set yet */
strbuf_addf(&sb, "submodule.%s.update", sub->name);
- if (git_config_get_string_tmp(sb.buf, &upd) &&
+ if (repo_config_get_string_tmp(the_repository, sb.buf, &upd) &&
sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) {
if (sub->update_strategy.type == SM_UPDATE_COMMAND) {
fprintf(stderr, _("warning: command update mode suggested for submodule '%s'\n"),
@@ -1034,7 +1034,7 @@ static void prepare_submodule_summary(struct summary_cb *info,
config_key = xstrfmt("submodule.%s.ignore",
sub->name);
- if (!git_config_get_string_tmp(config_key, &value))
+ if (!repo_config_get_string_tmp(the_repository, config_key, &value))
ignore_all = !strcmp(value, "all");
else if (sub->ignore)
ignore_all = !strcmp(sub->ignore, "all");