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_int()`. All
callsites are adjusted so that they use
`repo_config_get_int(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>
Patrick Steinhardt committedJul 23, 2025 at 16:08 UTC3fda14d86d91c665e3d7c50da242cc4ddd63eea5
13 files changed+31-36
builtin/credential-store.c
+1-1
index e669e99dbf..b74e06cc93 100644--- a/builtin/credential-store.c+++ b/builtin/credential-store.c@@ -66,7 +66,7 @@ static void rewrite_credential_file(const char *fn, struct credential *c, { int timeout_ms = 1000;- git_config_get_int("credentialstore.locktimeoutms", &timeout_ms);+ repo_config_get_int(the_repository, "credentialstore.locktimeoutms", &timeout_ms); if (hold_lock_file_for_update_timeout(&credential_lock, fn, 0, timeout_ms) < 0) die_errno(_("unable to get credential storage lock in %d ms"), timeout_ms); if (extra)
builtin/fast-import.c
+3-3
index 607441e921..9b0ae43714 100644--- a/builtin/fast-import.c+++ b/builtin/fast-import.c@@ -3527,7 +3527,7 @@ static void git_pack_config(void) if (max_depth > MAX_DEPTH) max_depth = MAX_DEPTH; }- if (!git_config_get_int("pack.indexversion", &indexversion_value)) {+ if (!repo_config_get_int(the_repository, "pack.indexversion", &indexversion_value)) { pack_idx_opts.version = indexversion_value; if (pack_idx_opts.version > 2) git_die_config(the_repository, "pack.indexversion",@@ -3536,9 +3536,9 @@ static void git_pack_config(void) if (!git_config_get_ulong("pack.packsizelimit", &packsizelimit_value)) max_packsize = packsizelimit_value;- if (!git_config_get_int("fastimport.unpacklimit", &limit))+ if (!repo_config_get_int(the_repository, "fastimport.unpacklimit", &limit)) unpack_limit = limit;- else if (!git_config_get_int("transfer.unpacklimit", &limit))+ else if (!repo_config_get_int(the_repository, "transfer.unpacklimit", &limit)) unpack_limit = limit; repo_config(the_repository, git_default_config, NULL);
builtin/fetch.c
+2-2
index 52eae4b972..24645c4653 100644--- a/builtin/fetch.c+++ b/builtin/fetch.c@@ -2683,12 +2683,12 @@ int cmd_fetch(int argc, * but respect config settings disabling it. */ int opt_val;- if (git_config_get_int("gc.autopacklimit", &opt_val))+ if (repo_config_get_int(the_repository, "gc.autopacklimit", &opt_val)) opt_val = -1; if (opt_val != 0) git_config_push_parameter("gc.autoPackLimit=1");- if (git_config_get_int("maintenance.incremental-repack.auto", &opt_val))+ if (repo_config_get_int(the_repository, "maintenance.incremental-repack.auto", &opt_val)) opt_val = -1; if (opt_val != 0) git_config_push_parameter("maintenance.incremental-repack.auto=-1");
index 98b2b476f0..d07dc18967 100644--- a/fsmonitor.c+++ b/fsmonitor.c@@ -43,7 +43,7 @@ static int fsmonitor_hook_version(void) { int hook_version;- if (git_config_get_int("core.fsmonitorhookversion", &hook_version))+ if (repo_config_get_int(the_repository, "core.fsmonitorhookversion", &hook_version)) return -1; if (hook_version == HOOK_INTERFACE_VERSION1 ||