Git fork

config: drop `git_config_get()` 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()`. All
callsites are adjusted so that they use `repo_config_get(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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
7807051e 83bd9e03

+5 -10
+1 -1
builtin/gc.c
··· 1916 1916 git_config_set("maintenance.auto", "false"); 1917 1917 1918 1918 /* Set maintenance strategy, if unset */ 1919 - if (git_config_get("maintenance.strategy")) 1919 + if (repo_config_get(the_repository, "maintenance.strategy")) 1920 1920 git_config_set("maintenance.strategy", "incremental"); 1921 1921 1922 1922 if (!git_config_get_string_multi(key, &list)) {
+3 -3
builtin/submodule--helper.c
··· 549 549 * If there are no path args and submodule.active is set then, 550 550 * by default, only initialize 'active' modules. 551 551 */ 552 - if (!argc && !git_config_get("submodule.active")) 552 + if (!argc && !repo_config_get(the_repository, "submodule.active")) 553 553 module_list_active(&list); 554 554 555 555 info.prefix = prefix; ··· 2878 2878 * If there are no path args and submodule.active is set then, 2879 2879 * by default, only initialize 'active' modules. 2880 2880 */ 2881 - if (!argc && !git_config_get("submodule.active")) 2881 + if (!argc && !repo_config_get(the_repository, "submodule.active")) 2882 2882 module_list_active(&list); 2883 2883 2884 2884 info.prefix = opt.prefix; ··· 3349 3349 * is_submodule_active(), since that function needs to find 3350 3350 * out the value of "submodule.active" again anyway. 3351 3351 */ 3352 - if (!git_config_get("submodule.active")) { 3352 + if (!repo_config_get(the_repository, "submodule.active")) { 3353 3353 /* 3354 3354 * If the submodule being added isn't already covered by the 3355 3355 * current configured pathspec, set the submodule's active flag
-5
config.h
··· 719 719 int lookup_config(const char **mapping, int nr_mapping, const char *var); 720 720 721 721 # ifdef USE_THE_REPOSITORY_VARIABLE 722 - static inline int git_config_get(const char *key) 723 - { 724 - return repo_config_get(the_repository, key); 725 - } 726 - 727 722 static inline int git_config_get_value(const char *key, const char **value) 728 723 { 729 724 return repo_config_get_value(the_repository, key, value);
+1 -1
t/helper/test-config.c
··· 137 137 } else if (argc == 3 && !strcmp(argv[1], "get")) { 138 138 int ret; 139 139 140 - if (!(ret = git_config_get(argv[2]))) 140 + if (!(ret = repo_config_get(the_repository, argv[2]))) 141 141 goto exit0; 142 142 else if (ret == 1) 143 143 printf("Value not found for \"%s\"\n", argv[2]);