Skip to content

Commit 4f5ba82

Browse files
pks-tgitster
authored andcommitted
config: drop git_config_get_string_multi() wrapper
In 036876a (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8e7110d commit 4f5ba82

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

builtin/gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ static int maintenance_register(int argc, const char **argv, const char *prefix,
19191919
if (repo_config_get(the_repository, "maintenance.strategy"))
19201920
git_config_set("maintenance.strategy", "incremental");
19211921

1922-
if (!git_config_get_string_multi(key, &list)) {
1922+
if (!repo_config_get_string_multi(the_repository, key, &list)) {
19231923
for_each_string_list_item(item, list) {
19241924
if (!strcmp(maintpath, item->string)) {
19251925
found = 1;
@@ -1988,7 +1988,7 @@ static int maintenance_unregister(int argc, const char **argv, const char *prefi
19881988
}
19891989
if (!(config_file
19901990
? 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))) {
19921992
for_each_string_list_item(item, list) {
19931993
if (!strcmp(maintpath, item->string)) {
19941994
found = 1;

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static void set_default_decoration_filter(struct decoration_filter *decoration_f
221221
struct string_list *include = decoration_filter->include_ref_pattern;
222222
const struct string_list *config_exclude;
223223

224-
if (!git_config_get_string_multi("log.excludeDecoration",
224+
if (!repo_config_get_string_multi(the_repository, "log.excludeDecoration",
225225
&config_exclude)) {
226226
struct string_list_item *item;
227227
for_each_string_list_item(item, config_exclude)

config.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -719,12 +719,6 @@ NORETURN void git_die_config_linenr(const char *key, const char *filename, int l
719719
int lookup_config(const char **mapping, int nr_mapping, const char *var);
720720

721721
# 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-
728722
static inline int git_config_get_string(const char *key, char **dest)
729723
{
730724
return repo_config_get_string(the_repository, key, dest);

reachable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static void load_gc_recent_objects(struct recent_data *data)
170170

171171
data->extra_recent_oids_loaded = 1;
172172

173-
if (git_config_get_string_multi("gc.recentobjectshook", &programs))
173+
if (repo_config_get_string_multi(the_repository, "gc.recentobjectshook", &programs))
174174
return;
175175

176176
for (i = 0; i < programs->nr; i++) {

versioncmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ int versioncmp(const char *s1, const char *s2)
167167
const char *const oldk = "versionsort.prereleasesuffix";
168168
const struct string_list *newl;
169169
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);
172172

173173
if (!new && !old)
174174
warning("ignoring %s because %s is set", oldk, newk);

0 commit comments

Comments
 (0)