config: drop `git_config()` 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()`. All callsites are adjusted so that they use `repo_config(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 9ce196e86b455fa2552812802c58f30c090c94af
118 files changed +148 -153
Documentation/user-manual.adoc
+1 -1
@@ -4270,7 +4270,7 @@ So, look into `builtin/cat-file.c`, search for `cmd_cat_file()` and look what
4270 it does.
4271
4272 ------------------------------------------------------------------
4273 - git_config(git_default_config);
4273 + repo_config(the_repository, git_default_config);
4274 if (argc != 3)
4275 usage("git cat-file [-t|-s|-e|-p|<type>] <sha1>");
4276 if (get_sha1(argv[2], sha1))
apply.c
+1 -1
@@ -50,7 +50,7 @@ static void git_apply_config(void)
50 {
51 git_config_get_string("apply.whitespace", &apply_default_whitespace);
52 git_config_get_string("apply.ignorewhitespace", &apply_default_ignorewhitespace);
53 - git_config(git_xmerge_config, NULL);
53 + repo_config(the_repository, git_xmerge_config, NULL);
54 }
55
56 static int parse_whitespace_option(struct apply_state *state, const char *option)
archive-tar.c
+1 -1
@@ -537,7 +537,7 @@ void init_tar_archiver(void)
537 tar_filter_config("tar.tgz.remote", "true", NULL);
538 tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
539 tar_filter_config("tar.tar.gz.remote", "true", NULL);
540 - git_config(git_tar_config, NULL);
540 + repo_config(the_repository, git_tar_config, NULL);
541 for (i = 0; i < nr_tar_filters; i++) {
542 /* omit any filters that never had a command configured */
543 if (tar_filters[i]->filter_command)
archive-zip.c
+1 -1
@@ -632,7 +632,7 @@ static int write_zip_archive(const struct archiver *ar UNUSED,
632 {
633 int err;
634
635 - git_config(archive_zip_config, NULL);
635 + repo_config(the_repository, archive_zip_config, NULL);
636
637 dos_time(&args->time, &zip_date, &zip_time);
638
archive.c
+1 -1
@@ -761,7 +761,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
761 int rc;
762
763 git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable);
764 - git_config(git_default_config, NULL);
764 + repo_config(the_repository, git_default_config, NULL);
765
766 describe_status.max_invocations = 1;
767 ctx.date_mode.type = DATE_NORMAL;
builtin/am.c
+1 -1
@@ -2445,7 +2445,7 @@ int cmd_am(int argc,
2445
2446 show_usage_with_options_if_asked(argc, argv, usage, options);
2447
2448 - git_config(git_default_config, NULL);
2448 + repo_config(the_repository, git_default_config, NULL);
2449
2450 am_state_init(&state);
2451
builtin/blame.c
+1 -1
@@ -947,7 +947,7 @@ int cmd_blame(int argc,
947 const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
948
949 setup_default_color_by_age();
950 - git_config(git_blame_config, &output_option);
950 + repo_config(the_repository, git_blame_config, &output_option);
951 repo_init_revisions(the_repository, &revs, NULL);
952 revs.date_mode = blame_date_mode;
953 revs.diffopt.flags.allow_textconv = 1;
builtin/branch.c
+1 -1
@@ -791,7 +791,7 @@ int cmd_branch(int argc,
791 * Try to set sort keys from config. If config does not set any,
792 * fall back on default (refname) sorting.
793 */
794 - git_config(git_branch_config, &sorting_options);
794 + repo_config(the_repository, git_branch_config, &sorting_options);
795 if (!sorting_options.nr)
796 string_list_append(&sorting_options, "refname");
797
builtin/cat-file.c
+1 -1
@@ -1095,7 +1095,7 @@ int cmd_cat_file(int argc,
1095 OPT_END()
1096 };
1097
1098 - git_config(git_cat_file_config, NULL);
1098 + repo_config(the_repository, git_cat_file_config, NULL);
1099
1100 batch.buffer_output = -1;
1101
builtin/check-attr.c
+1 -1
@@ -119,7 +119,7 @@ int cmd_check_attr(int argc,
119 if (!is_bare_repository())
120 setup_work_tree();
121
122 - git_config(git_default_config, NULL);
122 + repo_config(the_repository, git_default_config, NULL);
123
124 argc = parse_options(argc, argv, prefix, check_attr_options,
125 check_attr_usage, PARSE_OPT_KEEP_DASHDASH);
builtin/check-ignore.c
+1 -1
@@ -159,7 +159,7 @@ int cmd_check_ignore(int argc,
159 int num_ignored;
160 struct dir_struct dir = DIR_INIT;
161
162 - git_config(git_default_config, NULL);
162 + repo_config(the_repository, git_default_config, NULL);
163
164 argc = parse_options(argc, argv, prefix, check_ignore_options,
165 check_ignore_usage, 0);
builtin/check-mailmap.c
+1 -1
@@ -56,7 +56,7 @@ int cmd_check_mailmap(int argc,
56 int i;
57 struct string_list mailmap = STRING_LIST_INIT_NODUP;
58
59 - git_config(git_default_config, NULL);
59 + repo_config(the_repository, git_default_config, NULL);
60 argc = parse_options(argc, argv, prefix, check_mailmap_options,
61 check_mailmap_usage, 0);
62 if (argc == 0 && !use_stdin)
builtin/checkout--worker.c
+1 -1
@@ -132,7 +132,7 @@ int cmd_checkout__worker(int argc,
132 checkout_worker_usage,
133 checkout_worker_options);
134
135 - git_config(git_default_config, NULL);
135 + repo_config(the_repository, git_default_config, NULL);
136 argc = parse_options(argc, argv, prefix, checkout_worker_options,
137 checkout_worker_usage, 0);
138 if (argc > 0)
builtin/checkout.c
+1 -1
@@ -1764,7 +1764,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
1764 opts->prefix = prefix;
1765 opts->show_progress = -1;
1766
1767 - git_config(git_checkout_config, opts);
1767 + repo_config(the_repository, git_checkout_config, opts);
1768 if (the_repository->gitdir) {
1769 prepare_repo_settings(the_repository);
1770 the_repository->settings.command_requires_full_index = 0;
builtin/clean.c
+1 -1
@@ -949,7 +949,7 @@ int cmd_clean(int argc,
949 OPT_END()
950 };
951
952 - git_config(git_clean_config, NULL);
952 + repo_config(the_repository, git_clean_config, NULL);
953
954 argc = parse_options(argc, argv, prefix, options, builtin_clean_usage,
955 0);
builtin/clone.c
+2 -2
@@ -1001,7 +1001,7 @@ int cmd_clone(int argc,
1001
1002 packet_trace_identity("clone");
1003
1004 - git_config(git_clone_config, NULL);
1004 + repo_config(the_repository, git_clone_config, NULL);
1005
1006 argc = parse_options(argc, argv, prefix, builtin_clone_options,
1007 builtin_clone_usage, 0);
@@ -1242,7 +1242,7 @@ int cmd_clone(int argc,
1242 * re-read config after init_db and write_config to pick up any config
1243 * injected by --template and --config, respectively.
1244 */
1245 - git_config(git_clone_config, NULL);
1245 + repo_config(the_repository, git_clone_config, NULL);
1246
1247 /*
1248 * If option_reject_shallow is specified from CLI option,
builtin/column.c
+2 -2
@@ -42,9 +42,9 @@ int cmd_column(int argc,
42 /* This one is special and must be the first one */
43 if (argc > 1 && starts_with(argv[1], "--command=")) {
44 command = argv[1] + 10;
45 - git_config(column_config, (void *)command);
45 + repo_config(the_repository, column_config, (void *)command);
46 } else
47 - git_config(column_config, NULL);
47 + repo_config(the_repository, column_config, NULL);
48
49 memset(&copts, 0, sizeof(copts));
50 copts.padding = 1;
builtin/commit-graph.c
+2 -2
@@ -265,7 +265,7 @@ static int graph_write(int argc, const char **argv, const char *prefix,
265
266 trace2_cmd_mode("write");
267
268 - git_config(git_commit_graph_write_config, &opts);
268 + repo_config(the_repository, git_commit_graph_write_config, &opts);
269
270 argc = parse_options(argc, argv, prefix,
271 options,
@@ -347,7 +347,7 @@ int cmd_commit_graph(int argc,
347 };
348 struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts);
349
350 - git_config(git_default_config, NULL);
350 + repo_config(the_repository, git_default_config, NULL);
351
352 disable_replace_refs();
353 save_commit_buffer = 0;
builtin/commit-tree.c
+1 -1
@@ -125,7 +125,7 @@ int cmd_commit_tree(int argc,
125 };
126 int ret;
127
128 - git_config(git_default_config, NULL);
128 + repo_config(the_repository, git_default_config, NULL);
129
130 show_usage_with_options_if_asked(argc, argv,
131 commit_tree_usage, options);
builtin/commit.c
+2 -2
@@ -207,9 +207,9 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)
207 {
208 wt_status_prepare(the_repository, s);
209 init_diff_ui_defaults();
210 - git_config(fn, s);
210 + repo_config(the_repository, fn, s);
211 determine_whence(s);
212 - s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after git_config() */
212 + s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after repo_config() */
213 }
214
215 static void rollback_index_files(void)
builtin/config.c
+1 -1
@@ -1091,7 +1091,7 @@ static int show_editor(struct config_location_options *opts)
1091 die(_("editing stdin is not supported"));
1092 if (opts->source.blob)
1093 die(_("editing blobs is not supported"));
1094 - git_config(git_default_config, NULL);
1094 + repo_config(the_repository, git_default_config, NULL);
1095 config_file = opts->source.file ?
1096 xstrdup(opts->source.file) :
1097 repo_git_path(the_repository, "config");
builtin/count-objects.c
+1 -1
@@ -106,7 +106,7 @@ int cmd_count_objects(int argc,
106 OPT_END(),
107 };
108
109 - git_config(git_default_config, NULL);
109 + repo_config(the_repository, git_default_config, NULL);
110
111 argc = parse_options(argc, argv, prefix, opts, count_objects_usage, 0);
112 /* we do not take arguments other than flags for now */
builtin/credential.c
+1 -1
@@ -16,7 +16,7 @@ int cmd_credential(int argc,
16 const char *op;
17 struct credential c = CREDENTIAL_INIT;
18
19 - git_config(git_default_config, NULL);
19 + repo_config(the_repository, git_default_config, NULL);
20
21 show_usage_if_asked(argc, argv, usage_msg);
22 if (argc != 2)
builtin/describe.c
+1 -1
@@ -623,7 +623,7 @@ int cmd_describe(int argc,
623 OPT_END(),
624 };
625
626 - git_config(git_default_config, NULL);
626 + repo_config(the_repository, git_default_config, NULL);
627 argc = parse_options(argc, argv, prefix, options, describe_usage, 0);
628 if (abbrev < 0)
629 abbrev = DEFAULT_ABBREV;
builtin/diff-files.c
+1 -1
@@ -31,7 +31,7 @@ int cmd_diff_files(int argc,
31
32 show_usage_if_asked(argc, argv, diff_files_usage);
33
34 - git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
34 + repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
35
36 prepare_repo_settings(the_repository);
37 the_repository->settings.command_requires_full_index = 0;
builtin/diff-index.c
+1 -1
@@ -28,7 +28,7 @@ int cmd_diff_index(int argc,
28
29 show_usage_if_asked(argc, argv, diff_cache_usage);
30
31 - git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
31 + repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
32
33 prepare_repo_settings(the_repository);
34 the_repository->settings.command_requires_full_index = 0;
builtin/diff-tree.c
+1 -1
@@ -124,7 +124,7 @@ int cmd_diff_tree(int argc,
124
125 show_usage_if_asked(argc, argv, diff_tree_usage);
126
127 - git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
127 + repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
128
129 prepare_repo_settings(the_repository);
130 the_repository->settings.command_requires_full_index = 0;
builtin/diff.c
+1 -1
@@ -486,7 +486,7 @@ int cmd_diff(int argc,
486 repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
487
488 init_diff_ui_defaults();
489 - git_config(git_diff_ui_config, NULL);
489 + repo_config(the_repository, git_diff_ui_config, NULL);
490 prefix = precompose_argv_prefix(argc, argv, prefix);
491
492 repo_init_revisions(the_repository, &rev, prefix);
builtin/fast-export.c
+1 -1
@@ -1327,7 +1327,7 @@ int cmd_fast_export(int argc,
1327 usage_with_options (fast_export_usage, options);
1328
1329 /* we handle encodings */
1330 - git_config(git_default_config, NULL);
1330 + repo_config(the_repository, git_default_config, NULL);
1331
1332 repo_init_revisions(the_repository, &revs, prefix);
1333 init_revision_sources(&revision_sources);
builtin/fast-import.c
+1 -1
@@ -3541,7 +3541,7 @@ static void git_pack_config(void)
3541 else if (!git_config_get_int("transfer.unpacklimit", &limit))
3542 unpack_limit = limit;
3543
3544 - git_config(git_default_config, NULL);
3544 + repo_config(the_repository, git_default_config, NULL);
3545 }
3546
3547 static const char fast_import_usage[] =
builtin/fetch.c
+2 -2
@@ -1995,7 +1995,7 @@ static int add_remote_or_group(const char *name, struct string_list *list)
1995 struct remote_group_data g;
1996 g.name = name; g.list = list;
1997
1998 - git_config(get_remote_group, &g);
1998 + repo_config(the_repository, get_remote_group, &g);
1999 if (list->nr == prev_nr) {
2000 struct remote *remote = remote_get(name);
2001 if (!remote_is_configured(remote, 0))
@@ -2417,7 +2417,7 @@ int cmd_fetch(int argc,
2417 free(anon);
2418 }
2419
2420 - git_config(git_fetch_config, &config);
2420 + repo_config(the_repository, git_fetch_config, &config);
2421 if (the_repository->gitdir) {
2422 prepare_repo_settings(the_repository);
2423 the_repository->settings.command_requires_full_index = 0;
builtin/fmt-merge-msg.c
+1 -1
@@ -53,7 +53,7 @@ int cmd_fmt_merge_msg(int argc,
53 int ret;
54 struct fmt_merge_msg_opts opts;
55
56 - git_config(fmt_merge_msg_config, NULL);
56 + repo_config(the_repository, fmt_merge_msg_config, NULL);
57 argc = parse_options(argc, argv, prefix, options, fmt_merge_msg_usage,
58 0);
59 if (argc > 0)
builtin/fsck.c
+1 -1
@@ -987,7 +987,7 @@ int cmd_fsck(int argc,
987 if (name_objects)
988 fsck_enable_object_names(&fsck_walk_options);
989
990 - git_config(git_fsck_config, &fsck_obj_options);
990 + repo_config(the_repository, git_fsck_config, &fsck_obj_options);
991 prepare_repo_settings(the_repository);
992
993 if (check_references)
builtin/fsmonitor--daemon.c
+1 -1
@@ -1547,7 +1547,7 @@ int cmd_fsmonitor__daemon(int argc,
1547 OPT_END()
1548 };
1549
1550 - git_config(fsmonitor_config, NULL);
1550 + repo_config(the_repository, fsmonitor_config, NULL);
1551
1552 argc = parse_options(argc, argv, prefix, options,
1553 builtin_fsmonitor__daemon_usage, 0);
builtin/gc.c
+1 -1
@@ -228,7 +228,7 @@ static void gc_config(struct gc_config *cfg)
228 cfg->repack_filter_to = owned;
229 }
230
231 - git_config(git_default_config, NULL);
231 + repo_config(the_repository, git_default_config, NULL);
232 }
233
234 enum schedule_priority {
builtin/grep.c
+1 -1
@@ -1035,7 +1035,7 @@ int cmd_grep(int argc,
1035 grep_prefix = prefix;
1036
1037 grep_init(&opt, the_repository);
1038 - git_config(grep_cmd_config, &opt);
1038 + repo_config(the_repository, grep_cmd_config, &opt);
1039
1040 /*
1041 * If there is no -- then the paths must exist in the working
builtin/hash-object.c
+1 -1
@@ -111,7 +111,7 @@ int cmd_hash_object(int argc,
111 vpath = vpath_free;
112 }
113
114 - git_config(git_default_config, NULL);
114 + repo_config(the_repository, git_default_config, NULL);
115
116 if (stdin_paths) {
117 if (hashstdin)
builtin/help.c
+2 -2
@@ -210,7 +210,7 @@ static enum help_format parse_help_format(const char *format)
210 if (!strcmp(format, "web") || !strcmp(format, "html"))
211 return HELP_FORMAT_WEB;
212 /*
213 - * Please update _git_config() in git-completion.bash when you
213 + * Please update _repo_config() in git-completion.bash when you
214 * add new help formats.
215 */
216 die(_("unrecognized help format '%s'"), format);
@@ -706,7 +706,7 @@ int cmd_help(int argc,
706 }
707
708 setup_git_directory_gently(&nongit);
709 - git_config(git_help_config, NULL);
709 + repo_config(the_repository, git_help_config, NULL);
710
711 if (parsed_help_format != HELP_FORMAT_NONE)
712 help_format = parsed_help_format;
builtin/hook.c
+1 -1
@@ -55,7 +55,7 @@ static int run(int argc, const char **argv, const char *prefix,
55 strvec_push(&opt.args, argv[i]);
56
57 /* Need to take into account core.hooksPath */
58 - git_config(git_default_config, NULL);
58 + repo_config(the_repository, git_default_config, NULL);
59
60 hook_name = argv[0];
61 if (!ignore_missing)
builtin/index-pack.c
+1 -1
@@ -1917,7 +1917,7 @@ int cmd_index_pack(int argc,
1917
1918 reset_pack_idx_option(&opts);
1919 opts.flags |= WRITE_REV;
1920 - git_config(git_index_pack_config, &opts);
1920 + repo_config(the_repository, git_index_pack_config, &opts);
1921 if (prefix && chdir(prefix))
1922 die(_("Cannot come back to cwd"));
1923
builtin/interpret-trailers.c
+1 -1
@@ -220,7 +220,7 @@ int cmd_interpret_trailers(int argc,
220 OPT_END()
221 };
222
223 - git_config(git_default_config, NULL);
223 + repo_config(the_repository, git_default_config, NULL);
224
225 argc = parse_options(argc, argv, prefix, options,
226 git_interpret_trailers_usage, 0);
builtin/log.c
+10 -10
@@ -659,10 +659,10 @@ int cmd_whatchanged(int argc,
659
660 log_config_init(&cfg);
661 init_diff_ui_defaults();
662 - git_config(git_log_config, &cfg);
662 + repo_config(the_repository, git_log_config, &cfg);
663
664 repo_init_revisions(the_repository, &rev, prefix);
665 - git_config(grep_config, &rev.grep_filter);
665 + repo_config(the_repository, grep_config, &rev.grep_filter);
666
667 rev.diff = 1;
668 rev.simplify_history = 0;
@@ -790,7 +790,7 @@ int cmd_show(int argc,
790
791 log_config_init(&cfg);
792 init_diff_ui_defaults();
793 - git_config(git_log_config, &cfg);
793 + repo_config(the_repository, git_log_config, &cfg);
794
795 if (the_repository->gitdir) {
796 prepare_repo_settings(the_repository);
@@ -799,7 +799,7 @@ int cmd_show(int argc,
799
800 memset(&match_all, 0, sizeof(match_all));
801 repo_init_revisions(the_repository, &rev, prefix);
802 - git_config(grep_config, &rev.grep_filter);
802 + repo_config(the_repository, grep_config, &rev.grep_filter);
803
804 rev.diff = 1;
805 rev.always_show_header = 1;
@@ -907,11 +907,11 @@ int cmd_log_reflog(int argc,
907
908 log_config_init(&cfg);
909 init_diff_ui_defaults();
910 - git_config(git_log_config, &cfg);
910 + repo_config(the_repository, git_log_config, &cfg);
911
912 repo_init_revisions(the_repository, &rev, prefix);
913 init_reflog_walk(&rev.reflog_info);
914 - git_config(grep_config, &rev.grep_filter);
914 + repo_config(the_repository, grep_config, &rev.grep_filter);
915
916 rev.verbose_header = 1;
917 memset(&opt, 0, sizeof(opt));
@@ -952,10 +952,10 @@ int cmd_log(int argc,
952
953 log_config_init(&cfg);
954 init_diff_ui_defaults();
955 - git_config(git_log_config, &cfg);
955 + repo_config(the_repository, git_log_config, &cfg);
956
957 repo_init_revisions(the_repository, &rev, prefix);
958 - git_config(grep_config, &rev.grep_filter);
958 + repo_config(the_repository, grep_config, &rev.grep_filter);
959
960 rev.always_show_header = 1;
961 memset(&opt, 0, sizeof(opt));
@@ -2158,9 +2158,9 @@ int cmd_format_patch(int argc,
2158 format_config_init(&cfg);
2159 init_diff_ui_defaults();
2160 init_display_notes(&cfg.notes_opt);
2161 - git_config(git_format_config, &cfg);
2161 + repo_config(the_repository, git_format_config, &cfg);
2162 repo_init_revisions(the_repository, &rev, prefix);
2163 - git_config(grep_config, &rev.grep_filter);
2163 + repo_config(the_repository, grep_config, &rev.grep_filter);
2164
2165 rev.show_notes = cfg.show_notes;
2166 memcpy(&rev.notes_opt, &cfg.notes_opt, sizeof(cfg.notes_opt));
builtin/ls-tree.c
+1 -1
@@ -375,7 +375,7 @@ int cmd_ls_tree(int argc,
375 struct object_context obj_context = {0};
376 int ret;
377
378 - git_config(git_default_config, NULL);
378 + repo_config(the_repository, git_default_config, NULL);
379
380 argc = parse_options(argc, argv, prefix, ls_tree_options,
381 ls_tree_usage, 0);
builtin/merge-base.c
+1 -1
@@ -167,7 +167,7 @@ int cmd_merge_base(int argc,
167 OPT_END()
168 };
169
170 - git_config(git_default_config, NULL);
170 + repo_config(the_repository, git_default_config, NULL);
171 argc = parse_options(argc, argv, prefix, options, merge_base_usage, 0);
172
173 if (cmdmode == 'a') {
builtin/merge-file.c
+1 -1
@@ -97,7 +97,7 @@ int cmd_merge_file(int argc,
97
98 if (startup_info->have_repository) {
99 /* Read the configuration file */
100 - git_config(git_xmerge_config, NULL);
100 + repo_config(the_repository, git_xmerge_config, NULL);
101 if (0 <= git_xmerge_style)
102 xmp.style = git_xmerge_style;
103 }
builtin/merge-tree.c
+1 -1
@@ -683,7 +683,7 @@ int cmd_merge_tree(int argc,
683 if (argc != expected_remaining_argc)
684 usage_with_options(merge_tree_usage, mt_options);
685
686 - git_config(git_default_config, NULL);
686 + repo_config(the_repository, git_default_config, NULL);
687
688 /* Do the relevant type of merge */
689 if (o.mode == MODE_REAL)
builtin/merge.c
+1 -1
@@ -1392,7 +1392,7 @@ int cmd_merge(int argc,
1392 skip_prefix(branch, "refs/heads/", &branch);
1393
1394 init_diff_ui_defaults();
1395 - git_config(git_merge_config, NULL);
1395 + repo_config(the_repository, git_merge_config, NULL);
1396
1397 if (!branch || is_null_oid(&head_oid))
1398 head_commit = NULL;
builtin/mktag.c
+1 -1
@@ -98,7 +98,7 @@ int cmd_mktag(int argc,
98 fsck_set_msg_type_from_ids(&fsck_options, FSCK_MSG_EXTRA_HEADER_ENTRY,
99 FSCK_WARN);
100 /* config might set fsck.extraHeaderEntry=* again */
101 - git_config(git_fsck_config, &fsck_options);
101 + repo_config(the_repository, git_fsck_config, &fsck_options);
102 if (fsck_tag_standalone(NULL, buf.buf, buf.len, &fsck_options,
103 &tagged_oid, &tagged_type))
104 die(_("tag on stdin did not pass our strict fsck check"));
builtin/multi-pack-index.c
+2 -2
@@ -143,7 +143,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
143
144 opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
145
146 - git_config(git_multi_pack_index_write_config, NULL);
146 + repo_config(the_repository, git_multi_pack_index_write_config, NULL);
147
148 options = add_common_options(builtin_multi_pack_index_write_options);
149
@@ -290,7 +290,7 @@ int cmd_multi_pack_index(int argc,
290
291 disable_replace_refs();
292
293 - git_config(git_default_config, NULL);
293 + repo_config(the_repository, git_default_config, NULL);
294
295 if (the_repository &&
296 the_repository->objects &&
builtin/mv.c
+1 -1
@@ -239,7 +239,7 @@ int cmd_mv(int argc,
239 struct strbuf pathbuf = STRBUF_INIT;
240 int ret;
241
242 - git_config(git_default_config, NULL);
242 + repo_config(the_repository, git_default_config, NULL);
243
244 argc = parse_options(argc, argv, prefix, builtin_mv_options,
245 builtin_mv_usage, 0);
builtin/name-rev.c
+1 -1
@@ -600,7 +600,7 @@ int cmd_name_rev(int argc,
600
601 mem_pool_init(&string_pool, 0);
602 init_commit_rev_name(&rev_names);
603 - git_config(git_default_config, NULL);
603 + repo_config(the_repository, git_default_config, NULL);
604 argc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0);
605
606 #ifndef WITH_BREAKING_CHANGES
builtin/notes.c
+1 -1
@@ -1145,7 +1145,7 @@ int cmd_notes(int argc,
1145 OPT_END()
1146 };
1147
1148 - git_config(git_default_config, NULL);
1148 + repo_config(the_repository, git_default_config, NULL);
1149 argc = parse_options(argc, argv, prefix, options, git_notes_usage,
1150 PARSE_OPT_SUBCOMMAND_OPTIONAL);
1151 if (!fn) {
builtin/pack-objects.c
+1 -1
@@ -4924,7 +4924,7 @@ int cmd_pack_objects(int argc,
4924
4925 reset_pack_idx_option(&pack_idx_opts);
4926 pack_idx_opts.flags |= WRITE_REV;
4927 - git_config(git_pack_config, NULL);
4927 + repo_config(the_repository, git_pack_config, NULL);
4928 if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
4929 pack_idx_opts.flags &= ~WRITE_REV;
4930
builtin/patch-id.c
+1 -1
@@ -235,7 +235,7 @@ int cmd_patch_id(int argc,
235 OPT_END()
236 };
237
238 - git_config(git_patch_id_config, &config);
238 + repo_config(the_repository, git_patch_id_config, &config);
239
240 /* verbatim implies stable */
241 if (config.verbatim)
builtin/pull.c
+1 -1
@@ -999,7 +999,7 @@ int cmd_pull(int argc,
999 if (!getenv("GIT_REFLOG_ACTION"))
1000 set_reflog_message(argc, argv);
1001
1002 - git_config(git_pull_config, NULL);
1002 + repo_config(the_repository, git_pull_config, NULL);
1003 if (the_repository->gitdir) {
1004 prepare_repo_settings(the_repository);
1005 the_repository->settings.command_requires_full_index = 0;
builtin/push.c
+1 -1
@@ -598,7 +598,7 @@ int cmd_push(int argc,
598 };
599
600 packet_trace_identity("push");
601 - git_config(git_push_config, &flags);
601 + repo_config(the_repository, git_push_config, &flags);
602 argc = parse_options(argc, argv, prefix, options, push_usage, 0);
603 push_options = (push_options_cmdline.nr
604 ? &push_options_cmdline
builtin/range-diff.c
+1 -1
@@ -54,7 +54,7 @@ int cmd_range_diff(int argc,
54 struct object_id oid;
55 const char *three_dots = NULL;
56
57 - git_config(git_diff_ui_config, NULL);
57 + repo_config(the_repository, git_diff_ui_config, NULL);
58
59 repo_diff_setup(the_repository, &diffopt);
60
builtin/read-tree.c
+1 -1
@@ -168,7 +168,7 @@ int cmd_read_tree(int argc,
168 opts.src_index = the_repository->index;
169 opts.dst_index = the_repository->index;
170
171 - git_config(git_read_tree_config, NULL);
171 + repo_config(the_repository, git_read_tree_config, NULL);
172
173 argc = parse_options(argc, argv, cmd_prefix, read_tree_options,
174 read_tree_usage, 0);
builtin/rebase.c
+1 -1
@@ -1245,7 +1245,7 @@ int cmd_rebase(int argc,
1245 prepare_repo_settings(the_repository);
1246 the_repository->settings.command_requires_full_index = 0;
1247
1248 - git_config(rebase_config, &options);
1248 + repo_config(the_repository, rebase_config, &options);
1249 /* options.gpg_sign_opt will be either "-S" or NULL */
1250 gpg_sign = options.gpg_sign_opt ? "" : NULL;
1251 FREE_AND_NULL(options.gpg_sign_opt);
builtin/receive-pack.c
+1 -1
@@ -2613,7 +2613,7 @@ int cmd_receive_pack(int argc,
2613 if (!enter_repo(service_dir, 0))
2614 die("'%s' does not appear to be a git repository", service_dir);
2615
2616 - git_config(receive_pack_config, NULL);
2616 + repo_config(the_repository, receive_pack_config, NULL);
2617 if (cert_nonce_seed)
2618 push_cert_nonce = prepare_push_cert_nonce(service_dir, time(NULL));
2619
builtin/reflog.c
+1 -1
@@ -202,7 +202,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
202 OPT_END()
203 };
204
205 - git_config(reflog_expire_config, &opts);
205 + repo_config(the_repository, reflog_expire_config, &opts);
206
207 save_commit_buffer = 0;
208 do_all = status = 0;
builtin/refs.c
+1 -1
@@ -88,7 +88,7 @@ static int cmd_refs_verify(int argc, const char **argv, const char *prefix,
88 if (argc)
89 usage(_("'git refs verify' takes no arguments"));
90
91 - git_config(git_fsck_config, &fsck_refs_options);
91 + repo_config(the_repository, git_fsck_config, &fsck_refs_options);
92 prepare_repo_settings(the_repository);
93
94 worktrees = get_worktrees_without_reading_head();
builtin/remote.c
+3 -3
@@ -353,7 +353,7 @@ static void read_branches(void)
353 {
354 if (branch_list.nr)
355 return;
356 - git_config(config_read_branches, NULL);
356 + repo_config(the_repository, config_read_branches, NULL);
357 }
358
359 struct ref_states {
@@ -690,7 +690,7 @@ static void handle_push_default(const char* old_name, const char* new_name)
690 .origin = STRBUF_INIT,
691 .linenr = -1,
692 };
693 - git_config(config_read_push_default, &push_default);
693 + repo_config(the_repository, config_read_push_default, &push_default);
694 if (push_default.scope >= CONFIG_SCOPE_COMMAND)
695 ; /* pass */
696 else if (push_default.scope >= CONFIG_SCOPE_LOCAL) {
@@ -1620,7 +1620,7 @@ static int update(int argc, const char **argv, const char *prefix,
1620 strvec_push(&cmd.args, argv[i]);
1621
1622 if (strcmp(cmd.args.v[cmd.args.nr-1], "default") == 0) {
1623 - git_config(get_remote_default, &default_defined);
1623 + repo_config(the_repository, get_remote_default, &default_defined);
1624 if (!default_defined) {
1625 strvec_pop(&cmd.args);
1626 strvec_push(&cmd.args, "--all");
builtin/repack.c
+1 -1
@@ -1230,7 +1230,7 @@ int cmd_repack(int argc,
1230
1231 list_objects_filter_init(&po_args.filter_options);
1232
1233 - git_config(repack_config, &cruft_po_args);
1233 + repo_config(the_repository, repack_config, &cruft_po_args);
1234
1235 argc = parse_options(argc, argv, prefix, builtin_repack_options,
1236 git_repack_usage, 0);
builtin/replace.c
+1 -1
@@ -574,7 +574,7 @@ int cmd_replace(int argc,
574 };
575
576 disable_replace_refs();
577 - git_config(git_default_config, NULL);
577 + repo_config(the_repository, git_default_config, NULL);
578
579 argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
580
builtin/rerere.c
+1 -1
@@ -66,7 +66,7 @@ int cmd_rerere(int argc,
66
67 argc = parse_options(argc, argv, prefix, options, rerere_usage, 0);
68
69 - git_config(git_xmerge_config, NULL);
69 + repo_config(the_repository, git_xmerge_config, NULL);
70
71 if (autoupdate == 1)
72 flags = RERERE_AUTOUPDATE;
builtin/reset.c
+1 -1
@@ -377,7 +377,7 @@ int cmd_reset(int argc,
377 OPT_END()
378 };
379
380 - git_config(git_reset_config, NULL);
380 + repo_config(the_repository, git_reset_config, NULL);
381
382 argc = parse_options(argc, argv, prefix, options, git_reset_usage,
383 PARSE_OPT_KEEP_DASHDASH);
builtin/rev-list.c
+1 -1
@@ -636,7 +636,7 @@ int cmd_rev_list(int argc,
636
637 show_usage_if_asked(argc, argv, rev_list_usage);
638
639 - git_config(git_default_config, NULL);
639 + repo_config(the_repository, git_default_config, NULL);
640 repo_init_revisions(the_repository, &revs, prefix);
641 revs.abbrev = DEFAULT_ABBREV;
642 revs.commit_format = CMIT_FMT_UNSPECIFIED;
builtin/rev-parse.c
+2 -2
@@ -734,7 +734,7 @@ int cmd_rev_parse(int argc,
734 /* No options; just report on whether we're in a git repo or not. */
735 if (argc == 1) {
736 setup_git_directory();
737 - git_config(git_default_config, NULL);
737 + repo_config(the_repository, git_default_config, NULL);
738 return 0;
739 }
740
@@ -769,7 +769,7 @@ int cmd_rev_parse(int argc,
769 /* The rest of the options require a git repository. */
770 if (!did_repo_setup) {
771 prefix = setup_git_directory();
772 - git_config(git_default_config, NULL);
772 + repo_config(the_repository, git_default_config, NULL);
773 did_repo_setup = 1;
774
775 prepare_repo_settings(the_repository);
builtin/rm.c
+1 -1
@@ -271,7 +271,7 @@ int cmd_rm(int argc,
271 struct pathspec pathspec;
272 char *seen;
273
274 - git_config(git_default_config, NULL);
274 + repo_config(the_repository, git_default_config, NULL);
275
276 argc = parse_options(argc, argv, prefix, builtin_rm_options,
277 builtin_rm_usage, 0);
builtin/shortlog.c
+1 -1
@@ -421,7 +421,7 @@ int cmd_shortlog(int argc,
421 if (nongit && !the_hash_algo)
422 repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
423
424 - git_config(git_default_config, NULL);
424 + repo_config(the_repository, git_default_config, NULL);
425 shortlog_init(&log);
426 repo_init_revisions(the_repository, &rev, prefix);
427 parse_options_start(&ctx, argc, argv, prefix, options,
builtin/show-branch.c
+1 -1
@@ -710,7 +710,7 @@ int cmd_show_branch(int ac,
710
711 init_commit_name_slab(&name_slab);
712
713 - git_config(git_show_branch_config, NULL);
713 + repo_config(the_repository, git_show_branch_config, NULL);
714
715 /* If nothing is specified, try the default first */
716 if (ac == 1 && default_args.nr) {
builtin/show-ref.c
+1 -1
@@ -324,7 +324,7 @@ struct repository *repo UNUSED)
324 OPT_END()
325 };
326
327 - git_config(git_default_config, NULL);
327 + repo_config(the_repository, git_default_config, NULL);
328
329 argc = parse_options(argc, argv, prefix, show_ref_options,
330 show_ref_usage, 0);
builtin/sparse-checkout.c
+1 -1
@@ -1082,7 +1082,7 @@ int cmd_sparse_checkout(int argc,
1082 builtin_sparse_checkout_options,
1083 builtin_sparse_checkout_usage, 0);
1084
1085 - git_config(git_default_config, NULL);
1085 + repo_config(the_repository, git_default_config, NULL);
1086
1087 prepare_repo_settings(the_repository);
1088 the_repository->settings.command_requires_full_index = 0;
builtin/stash.c
+2 -2
@@ -979,7 +979,7 @@ static int show_stash(int argc, const char **argv, const char *prefix,
979 int do_usage = 0;
980
981 init_diff_ui_defaults();
982 - git_config(git_diff_ui_config, NULL);
982 + repo_config(the_repository, git_diff_ui_config, NULL);
983 repo_init_revisions(the_repository, &rev, prefix);
984
985 argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
@@ -2358,7 +2358,7 @@ int cmd_stash(int argc,
2358 const char **args_copy;
2359 int ret;
2360
2361 - git_config(git_stash_config, NULL);
2361 + repo_config(the_repository, git_stash_config, NULL);
2362
2363 argc = parse_options(argc, argv, prefix, options, git_stash_usage,
2364 PARSE_OPT_SUBCOMMAND_OPTIONAL |
builtin/stripspace.c
+1 -1
@@ -55,7 +55,7 @@ int cmd_stripspace(int argc,
55
56 if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
57 setup_git_directory_gently(&nongit);
58 - git_config(git_default_config, NULL);
58 + repo_config(the_repository, git_default_config, NULL);
59 }
60
61 if (strbuf_read(&buf, 0, 1024) < 0)
builtin/submodule--helper.c
+4 -4
@@ -649,7 +649,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
649 "--ignore-submodules=dirty", "--quiet", "--",
650 path, NULL);
651
652 - git_config(git_diff_basic_config, NULL);
652 + repo_config(the_repository, git_diff_basic_config, NULL);
653
654 repo_init_revisions(the_repository, &rev, NULL);
655 rev.abbrev = 0;
@@ -1108,7 +1108,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
1108 if (info->argc)
1109 strvec_pushv(&diff_args, info->argv);
1110
1111 - git_config(git_diff_basic_config, NULL);
1111 + repo_config(the_repository, git_diff_basic_config, NULL);
1112 repo_init_revisions(the_repository, &rev, info->prefix);
1113 rev.abbrev = 0;
1114 precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
@@ -2830,7 +2830,7 @@ static int module_update(int argc, const char **argv, const char *prefix,
2830 };
2831
2832 update_clone_config_from_gitmodules(&opt.max_jobs);
2833 - git_config(git_update_clone_config, &opt.max_jobs);
2833 + repo_config(the_repository, git_update_clone_config, &opt.max_jobs);
2834
2835 argc = parse_options(argc, argv, prefix, module_update_options,
2836 git_submodule_helper_usage, 0);
@@ -3128,7 +3128,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix,
3128 NULL
3129 };
3130
3131 - git_config(git_default_config, NULL);
3131 + repo_config(the_repository, git_default_config, NULL);
3132 track = git_branch_track;
3133 argc = parse_options(argc, argv, prefix, options, usage, 0);
3134
builtin/symbolic-ref.c
+1 -1
@@ -59,7 +59,7 @@ int cmd_symbolic_ref(int argc,
59 OPT_END(),
60 };
61
62 - git_config(git_default_config, NULL);
62 + repo_config(the_repository, git_default_config, NULL);
63 argc = parse_options(argc, argv, prefix, options,
64 git_symbolic_ref_usage, 0);
65 if (msg && !*msg)
builtin/tag.c
+1 -1
@@ -546,7 +546,7 @@ int cmd_tag(int argc,
546 * Try to set sort keys from config. If config does not set any,
547 * fall back on default (refname) sorting.
548 */
549 - git_config(git_tag_config, &sorting_options);
549 + repo_config(the_repository, git_tag_config, &sorting_options);
550 if (!sorting_options.nr)
551 string_list_append(&sorting_options, "refname");
552
builtin/unpack-file.c
+1 -1
@@ -43,7 +43,7 @@ int cmd_unpack_file(int argc,
43 if (repo_get_oid(the_repository, argv[1], &oid))
44 die("Not a valid object name %s", argv[1]);
45
46 - git_config(git_default_config, NULL);
46 + repo_config(the_repository, git_default_config, NULL);
47
48 puts(create_temp_file(&oid));
49 return 0;
builtin/unpack-objects.c
+1 -1
@@ -621,7 +621,7 @@ int cmd_unpack_objects(int argc,
621
622 disable_replace_refs();
623
624 - git_config(git_default_config, NULL);
624 + repo_config(the_repository, git_default_config, NULL);
625
626 quiet = !isatty(2);
627
builtin/update-index.c
+1 -1
@@ -1103,7 +1103,7 @@ int cmd_update_index(int argc,
1103 show_usage_with_options_if_asked(argc, argv,
1104 update_index_usage, options);
1105
1106 - git_config(git_default_config, NULL);
1106 + repo_config(the_repository, git_default_config, NULL);
1107
1108 prepare_repo_settings(r);
1109 the_repository->settings.command_requires_full_index = 0;
builtin/update-ref.c
+1 -1
@@ -769,7 +769,7 @@ int cmd_update_ref(int argc,
769 OPT_END(),
770 };
771
772 - git_config(git_default_config, NULL);
772 + repo_config(the_repository, git_default_config, NULL);
773 argc = parse_options(argc, argv, prefix, options, git_update_ref_usage,
774 0);
775 if (msg && !*msg)
builtin/var.c
+2 -2
@@ -226,11 +226,11 @@ int cmd_var(int argc,
226 usage(var_usage);
227
228 if (strcmp(argv[1], "-l") == 0) {
229 - git_config(show_config, NULL);
229 + repo_config(the_repository, show_config, NULL);
230 list_vars();
231 return 0;
232 }
233 - git_config(git_default_config, NULL);
233 + repo_config(the_repository, git_default_config, NULL);
234
235 git_var = get_git_var(argv[1]);
236 if (!git_var)
builtin/verify-pack.c
+1 -1
@@ -81,7 +81,7 @@ int cmd_verify_pack(int argc,
81 OPT_END()
82 };
83
84 - git_config(git_default_config, NULL);
84 + repo_config(the_repository, git_default_config, NULL);
85 argc = parse_options(argc, argv, prefix, verify_pack_options,
86 verify_pack_usage, 0);
87 if (argc < 1)
builtin/worktree.c
+1 -1
@@ -1448,7 +1448,7 @@ int cmd_worktree(int ac,
1448 OPT_END()
1449 };
1450
1451 - git_config(git_worktree_config, NULL);
1451 + repo_config(the_repository, git_worktree_config, NULL);
1452
1453 if (!prefix)
1454 prefix = "";
builtin/write-tree.c
+1 -1
@@ -43,7 +43,7 @@ int cmd_write_tree(int argc,
43 OPT_END()
44 };
45
46 - git_config(git_default_config, NULL);
46 + repo_config(the_repository, git_default_config, NULL);
47 argc = parse_options(argc, argv, cmd_prefix, write_tree_options,
48 write_tree_usage, 0);
49
config.h
-5
@@ -719,11 +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 void git_config(config_fn_t fn, void *data)
723 -{
724 - repo_config(the_repository, fn, data);
725 -}
726 -
722 static inline void git_config_clear(void)
723 {
724 repo_config_clear(the_repository);
connect.c
+1 -1
@@ -1028,7 +1028,7 @@ static int git_proxy_command_options(const char *var, const char *value,
1028 static int git_use_proxy(const char *host)
1029 {
1030 git_proxy_command = getenv("GIT_PROXY_COMMAND");
1031 - git_config(git_proxy_command_options, (void*)host);
1031 + repo_config(the_repository, git_proxy_command_options, (void*)host);
1032 return (git_proxy_command && *git_proxy_command);
1033 }
1034
contrib/coccinelle/config_fn_ctx.pending.cocci
+1 -1
@@ -83,7 +83,7 @@ int fn(const char *C1, const char *C2,
83
84
85 // The previous rules don't catch all callbacks, especially if they're defined
86 -// in a separate file from the git_config() call. Fix these manually.
86 +// in a separate file from the repo_config() call. Fix these manually.
87 @@
88 identifier C1, C2, D;
89 attribute name UNUSED;
convert.c
+1 -1
@@ -1326,7 +1326,7 @@ void convert_attrs(struct index_state *istate,
1326 "eol", "text", "working-tree-encoding",
1327 NULL);
1328 user_convert_tail = &user_convert;
1329 - git_config(read_convert_config, NULL);
1329 + repo_config(the_repository, read_convert_config, NULL);
1330 }
1331
1332 git_check_attr(istate, path, check);
fetch-pack.c
+1 -1
@@ -1916,7 +1916,7 @@ static void fetch_pack_config(void)
1916 }
1917 }
1918
1919 - git_config(fetch_pack_config_cb, NULL);
1919 + repo_config(the_repository, fetch_pack_config_cb, NULL);
1920 }
1921
1922 static void fetch_pack_setup(void)
fsck.h
+1 -1
@@ -287,7 +287,7 @@ const char *fsck_describe_object(struct fsck_options *options,
287
288 struct key_value_info;
289 /*
290 - * git_config() callback for use by fsck-y tools that want to support
290 + * repo_config() callback for use by fsck-y tools that want to support
291 * fsck.<msg> fsck.skipList etc.
292 */
293 int git_fsck_config(const char *var, const char *value,
gpg-interface.c
+1 -1
@@ -25,7 +25,7 @@ static void gpg_interface_lazy_init(void)
25 if (done)
26 return;
27 done = 1;
28 - git_config(git_gpg_config, NULL);
28 + repo_config(the_repository, git_gpg_config, NULL);
29 }
30
31 static char *configured_signing_key;
help.c
+2 -2
@@ -332,7 +332,7 @@ static int get_colopts(const char *var, const char *value,
332 void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
333 {
334 unsigned int colopts = 0;
335 - git_config(get_colopts, &colopts);
335 + repo_config(the_repository, get_colopts, &colopts);
336
337 if (main_cmds->cnt) {
338 const char *exec_path = git_exec_path();
@@ -502,7 +502,7 @@ static void list_all_cmds_help_aliases(int longest)
502 struct cmdname_help *aliases;
503 int i;
504
505 - git_config(get_alias, &alias_list);
505 + repo_config(the_repository, get_alias, &alias_list);
506 string_list_sort(&alias_list);
507
508 for (i = 0; i < alias_list.nr; i++) {
http-fetch.c
+1 -1
@@ -150,7 +150,7 @@ int cmd_main(int argc, const char **argv)
150
151 trace2_cmd_name("http-fetch");
152
153 - git_config(git_default_config, NULL);
153 + repo_config(the_repository, git_default_config, NULL);
154
155 if (packfile) {
156 if (!index_pack_args.nr)
http.c
+1 -1
@@ -1315,7 +1315,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
1315 http_is_verbose = 0;
1316 normalized_url = url_normalize(url, &config.url);
1317
1318 - git_config(urlmatch_config_entry, &config);
1318 + repo_config(the_repository, urlmatch_config_entry, &config);
1319 free(normalized_url);
1320 string_list_clear(&config.vars, 1);
1321
imap-send.c
+1 -1
@@ -1776,7 +1776,7 @@ int cmd_main(int argc, const char **argv)
1776 int ret;
1777
1778 setup_git_directory_gently(&nongit_ok);
1779 - git_config(git_imap_config, &server);
1779 + repo_config(the_repository, git_imap_config, &server);
1780
1781 argc = parse_options(argc, (const char **)argv, "", imap_send_options, imap_send_usage, 0);
1782
ls-refs.c
+1 -1
@@ -159,7 +159,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
159 strbuf_init(&data.buf, 0);
160 strvec_init(&data.hidden_refs);
161
162 - git_config(ls_refs_config, &data);
162 + repo_config(the_repository, ls_refs_config, &data);
163
164 while (packet_reader_read(request) == PACKET_READ_NORMAL) {
165 const char *arg = request->line;
merge-ll.c
+1 -1
@@ -357,7 +357,7 @@ static void initialize_ll_merge(void)
357 if (ll_user_merge_tail)
358 return;
359 ll_user_merge_tail = &ll_user_merge;
360 - git_config(read_merge_config, NULL);
360 + repo_config(the_repository, read_merge_config, NULL);
361 }
362
363 static const struct ll_merge_driver *find_ll_merge_driver(const char *merge_attr)
merge-ort.c
+1 -1
@@ -5387,7 +5387,7 @@ static void merge_recursive_config(struct merge_options *opt, int ui)
5387 free(value);
5388 }
5389 }
5390 - git_config(git_xmerge_config, NULL);
5390 + repo_config(the_repository, git_xmerge_config, NULL);
5391 }
5392
5393 static void init_merge_options(struct merge_options *opt,
notes-utils.c
+1 -1
@@ -162,7 +162,7 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)
162 c->refs_from_env = 1;
163 string_list_add_refs_from_colon_sep(c->refs, rewrite_refs_env);
164 }
165 - git_config(notes_rewrite_config, c);
165 + repo_config(the_repository, notes_rewrite_config, c);
166 if (!c->enabled || !c->refs->nr) {
167 string_list_clear(c->refs, 0);
168 free(c->refs);
notes.c
+1 -1
@@ -1123,7 +1123,7 @@ void load_display_notes(struct display_notes_opt *opt)
1123 load_config_refs = 1;
1124 }
1125
1126 - git_config(notes_display_config, &load_config_refs);
1126 + repo_config(the_repository, notes_display_config, &load_config_refs);
1127
1128 if (opt) {
1129 struct string_list_item *item;
pretty.c
+1 -1
@@ -141,7 +141,7 @@ static void setup_commit_formats(void)
141 COPY_ARRAY(commit_formats, builtin_formats,
142 ARRAY_SIZE(builtin_formats));
143
144 - git_config(git_pretty_formats_config, NULL);
144 + repo_config(the_repository, git_pretty_formats_config, NULL);
145 }
146
147 static struct cmt_fmt_map *find_commit_format_recursive(const char *sought,
refs/reftable-backend.c
+1 -1
@@ -386,7 +386,7 @@ static struct ref_store *reftable_be_init(struct repository *repo,
386 refs->write_options.lock_timeout_ms = 100;
387 refs->write_options.fsync = reftable_be_fsync;
388
389 - git_config(reftable_be_config, &refs->write_options);
389 + repo_config(the_repository, reftable_be_config, &refs->write_options);
390
391 /*
392 * It is somewhat unfortunate that we have to mirror the default block
rerere.c
+2 -2
@@ -879,7 +879,7 @@ static void git_rerere_config(void)
879 {
880 git_config_get_bool("rerere.enabled", &rerere_enabled);
881 git_config_get_bool("rerere.autoupdate", &rerere_autoupdate);
882 - git_config(git_default_config, NULL);
882 + repo_config(the_repository, git_default_config, NULL);
883 }
884
885 static GIT_PATH_FUNC(git_path_rr_cache, "rr-cache")
@@ -1247,7 +1247,7 @@ void rerere_gc(struct repository *r, struct string_list *rr)
1247 &cutoff_resolve, now);
1248 repo_config_get_expiry_in_days(the_repository, "gc.rerereunresolved",
1249 &cutoff_noresolve, now);
1250 - git_config(git_default_config, NULL);
1250 + repo_config(the_repository, git_default_config, NULL);
1251 dir = opendir(repo_git_path_replace(the_repository, &buf, "rr-cache"));
1252 if (!dir)
1253 die_errno(_("unable to open rr-cache directory"));
revision.c
+1 -1
@@ -1636,7 +1636,7 @@ void exclude_hidden_refs(struct ref_exclusions *exclusions, const char *section)
1636 cb.exclusions = exclusions;
1637 cb.section = section;
1638
1639 - git_config(hide_refs_config, &cb);
1639 + repo_config(the_repository, hide_refs_config, &cb);
1640 }
1641
1642 struct all_refs_cb {
scalar.c
+1 -1
@@ -713,7 +713,7 @@ static int cmd_reconfigure(int argc, const char **argv)
713 maintenance_str);
714 }
715
716 - git_config(get_scalar_repos, &scalar_repos);
716 + repo_config(the_repository, get_scalar_repos, &scalar_repos);
717
718 for (size_t i = 0; i < scalar_repos.nr; i++) {
719 int succeeded = 0;
sequencer.c
+1 -1
@@ -327,7 +327,7 @@ static int git_sequencer_config(const char *k, const char *v,
327 void sequencer_init_config(struct replay_opts *opts)
328 {
329 opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_NONE;
330 - git_config(git_sequencer_config, opts);
330 + repo_config(the_repository, git_sequencer_config, opts);
331 }
332
333 static inline int is_rebase_i(const struct replay_opts *opts)
setup.c
+2 -2
@@ -2339,7 +2339,7 @@ static int create_default_files(const char *template_path,
2339 copy_templates(template_path);
2340 git_config_clear();
2341 repo_settings_reset_shared_repository(the_repository);
2342 - git_config(git_default_config, NULL);
2342 + repo_config(the_repository, git_default_config, NULL);
2343
2344 reinit = is_reinit();
2345
@@ -2610,7 +2610,7 @@ int init_db(const char *git_dir, const char *real_git_dir,
2610 * have set up the repository format such that we can evaluate
2611 * includeIf conditions correctly in the case of re-initialization.
2612 */
2613 - git_config(platform_core_config, NULL);
2613 + repo_config(the_repository, platform_core_config, NULL);
2614
2615 safe_create_dir(the_repository, git_dir, 0);
2616
t/helper/test-advise.c
+1 -1
@@ -11,7 +11,7 @@ int cmd__advise_if_enabled(int argc, const char **argv)
11 die("usage: %s <advice>", argv[0]);
12
13 setup_git_directory();
14 - git_config(git_default_config, NULL);
14 + repo_config(the_repository, git_default_config, NULL);
15
16 /*
17 * Any advice type can be used for testing, but NESTED_TAG was
t/helper/test-config.c
+4 -4
@@ -32,10 +32,10 @@
32 * ascending order of priority from a config_set
33 * constructed from files entered as arguments.
34 *
35 - * iterate -> iterate over all values using git_config(), and print some
35 + * iterate -> iterate over all values using repo_config(), and print some
36 * data for each
37 *
38 - * git_config_int -> iterate over all values using git_config() and print the
38 + * git_config_int -> iterate over all values using repo_config() and print the
39 * integer value for the entered key or die
40 *
41 * Examples:
@@ -218,10 +218,10 @@ int cmd__config(int argc, const char **argv)
218 goto exit1;
219 }
220 } else if (!strcmp(argv[1], "iterate")) {
221 - git_config(iterate_cb, NULL);
221 + repo_config(the_repository, iterate_cb, NULL);
222 goto exit0;
223 } else if (argc == 3 && !strcmp(argv[1], "git_config_int")) {
224 - git_config(parse_int_cb, (void *) argv[2]);
224 + repo_config(the_repository, parse_int_cb, (void *) argv[2]);
225 goto exit0;
226 }
227
t/helper/test-read-cache.c
+1 -1
@@ -19,7 +19,7 @@ int cmd__read_cache(int argc, const char **argv)
19 if (argc == 2)
20 cnt = strtol(argv[1], NULL, 0);
21 setup_git_directory();
22 - git_config(git_default_config, NULL);
22 + repo_config(the_repository, git_default_config, NULL);
23
24 for (i = 0; i < cnt; i++) {
25 repo_read_index(the_repository);
t/helper/test-userdiff.c
+1 -1
@@ -41,7 +41,7 @@ int cmd__userdiff(int argc, const char **argv)
41
42 if (want & USERDIFF_DRIVER_TYPE_CUSTOM) {
43 setup_git_directory();
44 - git_config(cmd__userdiff_config, NULL);
44 + repo_config(the_repository, cmd__userdiff_config, NULL);
45 }
46
47 for_each_userdiff_driver(driver_cb, &want);
t/t4256/1/mailinfo.c
+1 -1
@@ -1214,7 +1214,7 @@ void setup_mailinfo(struct mailinfo *mi)
1214 mi->header_stage = 1;
1215 mi->use_inbody_headers = 1;
1216 mi->content_top = mi->content;
1217 - git_config(git_mailinfo_config, mi);
1217 + repo_config(the_repository, git_mailinfo_config, mi);
1218 }
1219
1220 void clear_mailinfo(struct mailinfo *mi)
t/t4256/1/mailinfo.c.orig
+1 -1
@@ -1154,7 +1154,7 @@ void setup_mailinfo(struct mailinfo *mi)
1154 mi->header_stage = 1;
1155 mi->use_inbody_headers = 1;
1156 mi->content_top = mi->content;
1157 - git_config(git_mailinfo_config, mi);
1157 + repo_config(the_repository, git_mailinfo_config, mi);
1158 }
1159
1160 void clear_mailinfo(struct mailinfo *mi)
trailer.c
+2 -2
@@ -595,8 +595,8 @@ void trailer_config_init(void)
595 default_conf_info.where = WHERE_END;
596 default_conf_info.if_exists = EXISTS_ADD_IF_DIFFERENT_NEIGHBOR;
597 default_conf_info.if_missing = MISSING_ADD;
598 - git_config(git_trailer_default_config, NULL);
599 - git_config(git_trailer_config, NULL);
598 + repo_config(the_repository, git_trailer_default_config, NULL);
599 + repo_config(the_repository, git_trailer_config, NULL);
600 configured = 1;
601 }
602
transport.c
+1 -1
@@ -202,7 +202,7 @@ static int fetch_refs_from_bundle(struct transport *transport,
202 if (!data->get_refs_from_bundle_called)
203 get_refs_from_bundle_inner(transport);
204
205 - git_config(fetch_fsck_config_cb, &msg_types);
205 + repo_config(the_repository, fetch_fsck_config_cb, &msg_types);
206 opts.fsck_msg_types = msg_types.buf;
207
208 ret = unbundle(the_repository, &data->header, data->fd,