config: drop `git_config_get_string_multi()` 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_multi()`. All callsites are adjusted so that they use `repo_config_get_string_multi(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 committed Jul 23, 2025 at 16:08 UTC 4f5ba823b879bbe0f06ceb6246755f39e793769f
5 files changed +6 -12
builtin/gc.c
+2 -2
@@ -1919,7 +1919,7 @@ static int maintenance_register(int argc, const char **argv, const char *prefix,
1919 if (repo_config_get(the_repository, "maintenance.strategy"))
1920 git_config_set("maintenance.strategy", "incremental");
1921
1922 - if (!git_config_get_string_multi(key, &list)) {
1922 + if (!repo_config_get_string_multi(the_repository, key, &list)) {
1923 for_each_string_list_item(item, list) {
1924 if (!strcmp(maintpath, item->string)) {
1925 found = 1;
@@ -1988,7 +1988,7 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
1988 }
1989 if (!(config_file
1990 ? git_configset_get_string_multi(&cs, key, &list)
1991 - : git_config_get_string_multi(key, &list))) {
1991 + : repo_config_get_string_multi(the_repository, key, &list))) {
1992 for_each_string_list_item(item, list) {
1993 if (!strcmp(maintpath, item->string)) {
1994 found = 1;
builtin/log.c
+1 -1
@@ -221,7 +221,7 @@ static void set_default_decoration_filter(struct decoration_filter *decoration_f
221 struct string_list *include = decoration_filter->include_ref_pattern;
222 const struct string_list *config_exclude;
223
224 - if (!git_config_get_string_multi("log.excludeDecoration",
224 + if (!repo_config_get_string_multi(the_repository, "log.excludeDecoration",
225 &config_exclude)) {
226 struct string_list_item *item;
227 for_each_string_list_item(item, config_exclude)
config.h
-6
@@ -719,12 +719,6 @@ NORETURN void git_die_config_linenr(const char *key, const char *filename, int l
719 int lookup_config(const char **mapping, int nr_mapping, const char *var);
720
721 # ifdef USE_THE_REPOSITORY_VARIABLE
722 -static inline int git_config_get_string_multi(const char *key,
723 - const struct string_list **dest)
724 -{
725 - return repo_config_get_string_multi(the_repository, key, dest);
726 -}
727 -
722 static inline int git_config_get_string(const char *key, char **dest)
723 {
724 return repo_config_get_string(the_repository, key, dest);
reachable.c
+1 -1
@@ -170,7 +170,7 @@ static void load_gc_recent_objects(struct recent_data *data)
170
171 data->extra_recent_oids_loaded = 1;
172
173 - if (git_config_get_string_multi("gc.recentobjectshook", &programs))
173 + if (repo_config_get_string_multi(the_repository, "gc.recentobjectshook", &programs))
174 return;
175
176 for (i = 0; i < programs->nr; i++) {
versioncmp.c
+2 -2
@@ -167,8 +167,8 @@ int versioncmp(const char *s1, const char *s2)
167 const char *const oldk = "versionsort.prereleasesuffix";
168 const struct string_list *newl;
169 const struct string_list *oldl;
170 - int new = git_config_get_string_multi(newk, &newl);
171 - int old = git_config_get_string_multi(oldk, &oldl);
170 + int new = repo_config_get_string_multi(the_repository, newk, &newl);
171 + int old = repo_config_get_string_multi(the_repository, oldk, &oldl);
172
173 if (!new && !old)
174 warning("ignoring %s because %s is set", oldk, newk);