]> Kevux Git Server - rit/commitdiff
config: drop `git_config()` wrapper
authorPatrick Steinhardt <ps@pks.im>
Wed, 23 Jul 2025 14:08:22 +0000 (16:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Jul 2025 15:15:18 +0000 (08:15 -0700)
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>
118 files changed:
Documentation/user-manual.adoc
apply.c
archive-tar.c
archive-zip.c
archive.c
builtin/am.c
builtin/blame.c
builtin/branch.c
builtin/cat-file.c
builtin/check-attr.c
builtin/check-ignore.c
builtin/check-mailmap.c
builtin/checkout--worker.c
builtin/checkout.c
builtin/clean.c
builtin/clone.c
builtin/column.c
builtin/commit-graph.c
builtin/commit-tree.c
builtin/commit.c
builtin/config.c
builtin/count-objects.c
builtin/credential.c
builtin/describe.c
builtin/diff-files.c
builtin/diff-index.c
builtin/diff-tree.c
builtin/diff.c
builtin/fast-export.c
builtin/fast-import.c
builtin/fetch.c
builtin/fmt-merge-msg.c
builtin/fsck.c
builtin/fsmonitor--daemon.c
builtin/gc.c
builtin/grep.c
builtin/hash-object.c
builtin/help.c
builtin/hook.c
builtin/index-pack.c
builtin/interpret-trailers.c
builtin/log.c
builtin/ls-tree.c
builtin/merge-base.c
builtin/merge-file.c
builtin/merge-tree.c
builtin/merge.c
builtin/mktag.c
builtin/multi-pack-index.c
builtin/mv.c
builtin/name-rev.c
builtin/notes.c
builtin/pack-objects.c
builtin/patch-id.c
builtin/pull.c
builtin/push.c
builtin/range-diff.c
builtin/read-tree.c
builtin/rebase.c
builtin/receive-pack.c
builtin/reflog.c
builtin/refs.c
builtin/remote.c
builtin/repack.c
builtin/replace.c
builtin/rerere.c
builtin/reset.c
builtin/rev-list.c
builtin/rev-parse.c
builtin/rm.c
builtin/shortlog.c
builtin/show-branch.c
builtin/show-ref.c
builtin/sparse-checkout.c
builtin/stash.c
builtin/stripspace.c
builtin/submodule--helper.c
builtin/symbolic-ref.c
builtin/tag.c
builtin/unpack-file.c
builtin/unpack-objects.c
builtin/update-index.c
builtin/update-ref.c
builtin/var.c
builtin/verify-pack.c
builtin/worktree.c
builtin/write-tree.c
config.h
connect.c
contrib/coccinelle/config_fn_ctx.pending.cocci
convert.c
fetch-pack.c
fsck.h
gpg-interface.c
help.c
http-fetch.c
http.c
imap-send.c
ls-refs.c
merge-ll.c
merge-ort.c
notes-utils.c
notes.c
pretty.c
refs/reftable-backend.c
rerere.c
revision.c
scalar.c
sequencer.c
setup.c
t/helper/test-advise.c
t/helper/test-config.c
t/helper/test-read-cache.c
t/helper/test-userdiff.c
t/t4256/1/mailinfo.c
t/t4256/1/mailinfo.c.orig
trailer.c
transport.c

index 8d00a9e..7696987 100644 (file)
@@ -4270,7 +4270,7 @@ So, look into `builtin/cat-file.c`, search for `cmd_cat_file()` and look what
 it does.
 
 ------------------------------------------------------------------
-        git_config(git_default_config);
+        repo_config(the_repository, git_default_config);
         if (argc != 3)
                usage("git cat-file [-t|-s|-e|-p|<type>] <sha1>");
         if (get_sha1(argv[2], sha1))
diff --git a/apply.c b/apply.c
index a380431..d2381a1 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -50,7 +50,7 @@ static void git_apply_config(void)
 {
        git_config_get_string("apply.whitespace", &apply_default_whitespace);
        git_config_get_string("apply.ignorewhitespace", &apply_default_ignorewhitespace);
-       git_config(git_xmerge_config, NULL);
+       repo_config(the_repository, git_xmerge_config, NULL);
 }
 
 static int parse_whitespace_option(struct apply_state *state, const char *option)
index 249164e..73b63dd 100644 (file)
@@ -537,7 +537,7 @@ void init_tar_archiver(void)
        tar_filter_config("tar.tgz.remote", "true", NULL);
        tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
        tar_filter_config("tar.tar.gz.remote", "true", NULL);
-       git_config(git_tar_config, NULL);
+       repo_config(the_repository, git_tar_config, NULL);
        for (i = 0; i < nr_tar_filters; i++) {
                /* omit any filters that never had a command configured */
                if (tar_filters[i]->filter_command)
index df8866d..dbd90d9 100644 (file)
@@ -632,7 +632,7 @@ static int write_zip_archive(const struct archiver *ar UNUSED,
 {
        int err;
 
-       git_config(archive_zip_config, NULL);
+       repo_config(the_repository, archive_zip_config, NULL);
 
        dos_time(&args->time, &zip_date, &zip_time);
 
index f5a9d45..2dd306a 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -761,7 +761,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
        int rc;
 
        git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable);
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        describe_status.max_invocations = 1;
        ctx.date_mode.type = DATE_NORMAL;
index c9d925f..a7e7cf1 100644 (file)
@@ -2445,7 +2445,7 @@ int cmd_am(int argc,
 
        show_usage_with_options_if_asked(argc, argv, usage, options);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        am_state_init(&state);
 
index 91586e6..71efeb7 100644 (file)
@@ -947,7 +947,7 @@ int cmd_blame(int argc,
        const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
 
        setup_default_color_by_age();
-       git_config(git_blame_config, &output_option);
+       repo_config(the_repository, git_blame_config, &output_option);
        repo_init_revisions(the_repository, &revs, NULL);
        revs.date_mode = blame_date_mode;
        revs.diffopt.flags.allow_textconv = 1;
index c150131..08e50bf 100644 (file)
@@ -791,7 +791,7 @@ int cmd_branch(int argc,
         * Try to set sort keys from config. If config does not set any,
         * fall back on default (refname) sorting.
         */
-       git_config(git_branch_config, &sorting_options);
+       repo_config(the_repository, git_branch_config, &sorting_options);
        if (!sorting_options.nr)
                string_list_append(&sorting_options, "refname");
 
index 2492a0b..b9eb2bb 100644 (file)
@@ -1095,7 +1095,7 @@ int cmd_cat_file(int argc,
                OPT_END()
        };
 
-       git_config(git_cat_file_config, NULL);
+       repo_config(the_repository, git_cat_file_config, NULL);
 
        batch.buffer_output = -1;
 
index 7cf275b..51ed48c 100644 (file)
@@ -119,7 +119,7 @@ int cmd_check_attr(int argc,
        if (!is_bare_repository())
                setup_work_tree();
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, check_attr_options,
                             check_attr_usage, PARSE_OPT_KEEP_DASHDASH);
index 7b7831d..0303349 100644 (file)
@@ -159,7 +159,7 @@ int cmd_check_ignore(int argc,
        int num_ignored;
        struct dir_struct dir = DIR_INIT;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, check_ignore_options,
                             check_ignore_usage, 0);
index be2cebe..634626c 100644 (file)
@@ -56,7 +56,7 @@ int cmd_check_mailmap(int argc,
        int i;
        struct string_list mailmap = STRING_LIST_INIT_NODUP;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, check_mailmap_options,
                             check_mailmap_usage, 0);
        if (argc == 0 && !use_stdin)
index da9345a..27a7d4f 100644 (file)
@@ -132,7 +132,7 @@ int cmd_checkout__worker(int argc,
                                         checkout_worker_usage,
                                         checkout_worker_options);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, checkout_worker_options,
                             checkout_worker_usage, 0);
        if (argc > 0)
index 0a90b86..948ff7b 100644 (file)
@@ -1764,7 +1764,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
        opts->prefix = prefix;
        opts->show_progress = -1;
 
-       git_config(git_checkout_config, opts);
+       repo_config(the_repository, git_checkout_config, opts);
        if (the_repository->gitdir) {
                prepare_repo_settings(the_repository);
                the_repository->settings.command_requires_full_index = 0;
index 053c94f..5ee147c 100644 (file)
@@ -949,7 +949,7 @@ int cmd_clean(int argc,
                OPT_END()
        };
 
-       git_config(git_clean_config, NULL);
+       repo_config(the_repository, git_clean_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, builtin_clean_usage,
                             0);
index 6d08abe..3c6d852 100644 (file)
@@ -1001,7 +1001,7 @@ int cmd_clone(int argc,
 
        packet_trace_identity("clone");
 
-       git_config(git_clone_config, NULL);
+       repo_config(the_repository, git_clone_config, NULL);
 
        argc = parse_options(argc, argv, prefix, builtin_clone_options,
                             builtin_clone_usage, 0);
@@ -1242,7 +1242,7 @@ int cmd_clone(int argc,
         * re-read config after init_db and write_config to pick up any config
         * injected by --template and --config, respectively.
         */
-       git_config(git_clone_config, NULL);
+       repo_config(the_repository, git_clone_config, NULL);
 
        /*
         * If option_reject_shallow is specified from CLI option,
index ce6443d..87dce3c 100644 (file)
@@ -42,9 +42,9 @@ int cmd_column(int argc,
        /* This one is special and must be the first one */
        if (argc > 1 && starts_with(argv[1], "--command=")) {
                command = argv[1] + 10;
-               git_config(column_config, (void *)command);
+               repo_config(the_repository, column_config, (void *)command);
        } else
-               git_config(column_config, NULL);
+               repo_config(the_repository, column_config, NULL);
 
        memset(&copts, 0, sizeof(copts));
        copts.padding = 1;
index 25018a0..c5cc601 100644 (file)
@@ -265,7 +265,7 @@ static int graph_write(int argc, const char **argv, const char *prefix,
 
        trace2_cmd_mode("write");
 
-       git_config(git_commit_graph_write_config, &opts);
+       repo_config(the_repository, git_commit_graph_write_config, &opts);
 
        argc = parse_options(argc, argv, prefix,
                             options,
@@ -347,7 +347,7 @@ int cmd_commit_graph(int argc,
        };
        struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        disable_replace_refs();
        save_commit_buffer = 0;
index 31cfd9b..2f1df28 100644 (file)
@@ -125,7 +125,7 @@ int cmd_commit_tree(int argc,
        };
        int ret;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        show_usage_with_options_if_asked(argc, argv,
                                         commit_tree_usage, options);
index fba0dde..fcd829e 100644 (file)
@@ -207,9 +207,9 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)
 {
        wt_status_prepare(the_repository, s);
        init_diff_ui_defaults();
-       git_config(fn, s);
+       repo_config(the_repository, fn, s);
        determine_whence(s);
-       s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after git_config() */
+       s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after repo_config() */
 }
 
 static void rollback_index_files(void)
index 5efe273..af5d79e 100644 (file)
@@ -1091,7 +1091,7 @@ static int show_editor(struct config_location_options *opts)
                die(_("editing stdin is not supported"));
        if (opts->source.blob)
                die(_("editing blobs is not supported"));
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        config_file = opts->source.file ?
                        xstrdup(opts->source.file) :
                        repo_git_path(the_repository, "config");
index f687647..433daff 100644 (file)
@@ -106,7 +106,7 @@ int cmd_count_objects(int argc,
                OPT_END(),
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, opts, count_objects_usage, 0);
        /* we do not take arguments other than flags for now */
index 2e11b15..52f172e 100644 (file)
@@ -16,7 +16,7 @@ int cmd_credential(int argc,
        const char *op;
        struct credential c = CREDENTIAL_INIT;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        show_usage_if_asked(argc, argv, usage_msg);
        if (argc != 2)
index fbf305d..d7dd813 100644 (file)
@@ -623,7 +623,7 @@ int cmd_describe(int argc,
                OPT_END(),
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, options, describe_usage, 0);
        if (abbrev < 0)
                abbrev = DEFAULT_ABBREV;
index 99b1749..ea91347 100644 (file)
@@ -31,7 +31,7 @@ int cmd_diff_files(int argc,
 
        show_usage_if_asked(argc, argv, diff_files_usage);
 
-       git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+       repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
 
        prepare_repo_settings(the_repository);
        the_repository->settings.command_requires_full_index = 0;
index 81c0bc8..522dacf 100644 (file)
@@ -28,7 +28,7 @@ int cmd_diff_index(int argc,
 
        show_usage_if_asked(argc, argv, diff_cache_usage);
 
-       git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+       repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
 
        prepare_repo_settings(the_repository);
        the_repository->settings.command_requires_full_index = 0;
index e31cc79..49dd4d0 100644 (file)
@@ -124,7 +124,7 @@ int cmd_diff_tree(int argc,
 
        show_usage_if_asked(argc, argv, diff_tree_usage);
 
-       git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+       repo_config(the_repository, git_diff_basic_config, NULL); /* no "diff" UI options */
 
        prepare_repo_settings(the_repository);
        the_repository->settings.command_requires_full_index = 0;
index eebffe3..9a89e25 100644 (file)
@@ -486,7 +486,7 @@ int cmd_diff(int argc,
                repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
 
        init_diff_ui_defaults();
-       git_config(git_diff_ui_config, NULL);
+       repo_config(the_repository, git_diff_ui_config, NULL);
        prefix = precompose_argv_prefix(argc, argv, prefix);
 
        repo_init_revisions(the_repository, &rev, prefix);
index 6a3a17a..17027b8 100644 (file)
@@ -1327,7 +1327,7 @@ int cmd_fast_export(int argc,
                usage_with_options (fast_export_usage, options);
 
        /* we handle encodings */
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        repo_init_revisions(the_repository, &revs, prefix);
        init_revision_sources(&revision_sources);
index b1389c5..607441e 100644 (file)
@@ -3541,7 +3541,7 @@ static void git_pack_config(void)
        else if (!git_config_get_int("transfer.unpacklimit", &limit))
                unpack_limit = limit;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 }
 
 static const char fast_import_usage[] =
index 87a0cca..ea447c4 100644 (file)
@@ -1995,7 +1995,7 @@ static int add_remote_or_group(const char *name, struct string_list *list)
        struct remote_group_data g;
        g.name = name; g.list = list;
 
-       git_config(get_remote_group, &g);
+       repo_config(the_repository, get_remote_group, &g);
        if (list->nr == prev_nr) {
                struct remote *remote = remote_get(name);
                if (!remote_is_configured(remote, 0))
@@ -2417,7 +2417,7 @@ int cmd_fetch(int argc,
                free(anon);
        }
 
-       git_config(git_fetch_config, &config);
+       repo_config(the_repository, git_fetch_config, &config);
        if (the_repository->gitdir) {
                prepare_repo_settings(the_repository);
                the_repository->settings.command_requires_full_index = 0;
index 3b6aac2..edb93c0 100644 (file)
@@ -53,7 +53,7 @@ int cmd_fmt_merge_msg(int argc,
        int ret;
        struct fmt_merge_msg_opts opts;
 
-       git_config(fmt_merge_msg_config, NULL);
+       repo_config(the_repository, fmt_merge_msg_config, NULL);
        argc = parse_options(argc, argv, prefix, options, fmt_merge_msg_usage,
                             0);
        if (argc > 0)
index 0084cf7..0ec6ca0 100644 (file)
@@ -987,7 +987,7 @@ int cmd_fsck(int argc,
        if (name_objects)
                fsck_enable_object_names(&fsck_walk_options);
 
-       git_config(git_fsck_config, &fsck_obj_options);
+       repo_config(the_repository, git_fsck_config, &fsck_obj_options);
        prepare_repo_settings(the_repository);
 
        if (check_references)
index 0820e52..469c62b 100644 (file)
@@ -1547,7 +1547,7 @@ int cmd_fsmonitor__daemon(int argc,
                OPT_END()
        };
 
-       git_config(fsmonitor_config, NULL);
+       repo_config(the_repository, fsmonitor_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options,
                             builtin_fsmonitor__daemon_usage, 0);
index fab8f4d..d9e3b9d 100644 (file)
@@ -228,7 +228,7 @@ static void gc_config(struct gc_config *cfg)
                cfg->repack_filter_to = owned;
        }
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 }
 
 enum schedule_priority {
index 39273d9..7982dda 100644 (file)
@@ -1035,7 +1035,7 @@ int cmd_grep(int argc,
        grep_prefix = prefix;
 
        grep_init(&opt, the_repository);
-       git_config(grep_cmd_config, &opt);
+       repo_config(the_repository, grep_cmd_config, &opt);
 
        /*
         * If there is no -- then the paths must exist in the working
index ddf2814..c3ad1e9 100644 (file)
@@ -111,7 +111,7 @@ int cmd_hash_object(int argc,
                vpath = vpath_free;
        }
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        if (stdin_paths) {
                if (hashstdin)
index c257079..d79ecd9 100644 (file)
@@ -210,7 +210,7 @@ static enum help_format parse_help_format(const char *format)
        if (!strcmp(format, "web") || !strcmp(format, "html"))
                return HELP_FORMAT_WEB;
        /*
-        * Please update _git_config() in git-completion.bash when you
+        * Please update _repo_config() in git-completion.bash when you
         * add new help formats.
         */
        die(_("unrecognized help format '%s'"), format);
@@ -706,7 +706,7 @@ int cmd_help(int argc,
        }
 
        setup_git_directory_gently(&nongit);
-       git_config(git_help_config, NULL);
+       repo_config(the_repository, git_help_config, NULL);
 
        if (parsed_help_format != HELP_FORMAT_NONE)
                help_format = parsed_help_format;
index 672d2e3..044c27a 100644 (file)
@@ -55,7 +55,7 @@ static int run(int argc, const char **argv, const char *prefix,
                strvec_push(&opt.args, argv[i]);
 
        /* Need to take into account core.hooksPath */
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        hook_name = argv[0];
        if (!ignore_missing)
index 0a5c8a1..53f1a7c 100644 (file)
@@ -1917,7 +1917,7 @@ int cmd_index_pack(int argc,
 
        reset_pack_idx_option(&opts);
        opts.flags |= WRITE_REV;
-       git_config(git_index_pack_config, &opts);
+       repo_config(the_repository, git_index_pack_config, &opts);
        if (prefix && chdir(prefix))
                die(_("Cannot come back to cwd"));
 
index 44d8ccd..3141c37 100644 (file)
@@ -220,7 +220,7 @@ int cmd_interpret_trailers(int argc,
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options,
                             git_interpret_trailers_usage, 0);
index 24a57c2..1bedc4e 100644 (file)
@@ -659,10 +659,10 @@ int cmd_whatchanged(int argc,
 
        log_config_init(&cfg);
        init_diff_ui_defaults();
-       git_config(git_log_config, &cfg);
+       repo_config(the_repository, git_log_config, &cfg);
 
        repo_init_revisions(the_repository, &rev, prefix);
-       git_config(grep_config, &rev.grep_filter);
+       repo_config(the_repository, grep_config, &rev.grep_filter);
 
        rev.diff = 1;
        rev.simplify_history = 0;
@@ -790,7 +790,7 @@ int cmd_show(int argc,
 
        log_config_init(&cfg);
        init_diff_ui_defaults();
-       git_config(git_log_config, &cfg);
+       repo_config(the_repository, git_log_config, &cfg);
 
        if (the_repository->gitdir) {
                prepare_repo_settings(the_repository);
@@ -799,7 +799,7 @@ int cmd_show(int argc,
 
        memset(&match_all, 0, sizeof(match_all));
        repo_init_revisions(the_repository, &rev, prefix);
-       git_config(grep_config, &rev.grep_filter);
+       repo_config(the_repository, grep_config, &rev.grep_filter);
 
        rev.diff = 1;
        rev.always_show_header = 1;
@@ -907,11 +907,11 @@ int cmd_log_reflog(int argc,
 
        log_config_init(&cfg);
        init_diff_ui_defaults();
-       git_config(git_log_config, &cfg);
+       repo_config(the_repository, git_log_config, &cfg);
 
        repo_init_revisions(the_repository, &rev, prefix);
        init_reflog_walk(&rev.reflog_info);
-       git_config(grep_config, &rev.grep_filter);
+       repo_config(the_repository, grep_config, &rev.grep_filter);
 
        rev.verbose_header = 1;
        memset(&opt, 0, sizeof(opt));
@@ -952,10 +952,10 @@ int cmd_log(int argc,
 
        log_config_init(&cfg);
        init_diff_ui_defaults();
-       git_config(git_log_config, &cfg);
+       repo_config(the_repository, git_log_config, &cfg);
 
        repo_init_revisions(the_repository, &rev, prefix);
-       git_config(grep_config, &rev.grep_filter);
+       repo_config(the_repository, grep_config, &rev.grep_filter);
 
        rev.always_show_header = 1;
        memset(&opt, 0, sizeof(opt));
@@ -2158,9 +2158,9 @@ int cmd_format_patch(int argc,
        format_config_init(&cfg);
        init_diff_ui_defaults();
        init_display_notes(&cfg.notes_opt);
-       git_config(git_format_config, &cfg);
+       repo_config(the_repository, git_format_config, &cfg);
        repo_init_revisions(the_repository, &rev, prefix);
-       git_config(grep_config, &rev.grep_filter);
+       repo_config(the_repository, grep_config, &rev.grep_filter);
 
        rev.show_notes = cfg.show_notes;
        memcpy(&rev.notes_opt, &cfg.notes_opt, sizeof(cfg.notes_opt));
index 4d616dd..4ba84e5 100644 (file)
@@ -375,7 +375,7 @@ int cmd_ls_tree(int argc,
        struct object_context obj_context = {0};
        int ret;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, ls_tree_options,
                             ls_tree_usage, 0);
index 123c815..8fde35c 100644 (file)
@@ -167,7 +167,7 @@ int cmd_merge_base(int argc,
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, options, merge_base_usage, 0);
 
        if (cmdmode == 'a') {
index 9464f27..3da4ca2 100644 (file)
@@ -97,7 +97,7 @@ int cmd_merge_file(int argc,
 
        if (startup_info->have_repository) {
                /* Read the configuration file */
-               git_config(git_xmerge_config, NULL);
+               repo_config(the_repository, git_xmerge_config, NULL);
                if (0 <= git_xmerge_style)
                        xmp.style = git_xmerge_style;
        }
index cf8b06c..99a6495 100644 (file)
@@ -683,7 +683,7 @@ int cmd_merge_tree(int argc,
        if (argc != expected_remaining_argc)
                usage_with_options(merge_tree_usage, mt_options);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        /* Do the relevant type of merge */
        if (o.mode == MODE_REAL)
index 18b22c0..dc4cb8f 100644 (file)
@@ -1392,7 +1392,7 @@ int cmd_merge(int argc,
                skip_prefix(branch, "refs/heads/", &branch);
 
        init_diff_ui_defaults();
-       git_config(git_merge_config, NULL);
+       repo_config(the_repository, git_merge_config, NULL);
 
        if (!branch || is_null_oid(&head_oid))
                head_commit = NULL;
index 27e6497..e078c97 100644 (file)
@@ -98,7 +98,7 @@ int cmd_mktag(int argc,
        fsck_set_msg_type_from_ids(&fsck_options, FSCK_MSG_EXTRA_HEADER_ENTRY,
                                   FSCK_WARN);
        /* config might set fsck.extraHeaderEntry=* again */
-       git_config(git_fsck_config, &fsck_options);
+       repo_config(the_repository, git_fsck_config, &fsck_options);
        if (fsck_tag_standalone(NULL, buf.buf, buf.len, &fsck_options,
                                &tagged_oid, &tagged_type))
                die(_("tag on stdin did not pass our strict fsck check"));
index aa25b06..9a113f0 100644 (file)
@@ -143,7 +143,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
 
        opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
 
-       git_config(git_multi_pack_index_write_config, NULL);
+       repo_config(the_repository, git_multi_pack_index_write_config, NULL);
 
        options = add_common_options(builtin_multi_pack_index_write_options);
 
@@ -290,7 +290,7 @@ int cmd_multi_pack_index(int argc,
 
        disable_replace_refs();
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        if (the_repository &&
            the_repository->objects &&
index 07548fe..d439250 100644 (file)
@@ -239,7 +239,7 @@ int cmd_mv(int argc,
        struct strbuf pathbuf = STRBUF_INIT;
        int ret;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, builtin_mv_options,
                             builtin_mv_usage, 0);
index ff19963..74512e5 100644 (file)
@@ -600,7 +600,7 @@ int cmd_name_rev(int argc,
 
        mem_pool_init(&string_pool, 0);
        init_commit_rev_name(&rev_names);
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0);
 
 #ifndef WITH_BREAKING_CHANGES
index a9529b1..17004cd 100644 (file)
@@ -1145,7 +1145,7 @@ int cmd_notes(int argc,
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, options, git_notes_usage,
                             PARSE_OPT_SUBCOMMAND_OPTIONAL);
        if (!fn) {
index 5781dec..8c86ec2 100644 (file)
@@ -4924,7 +4924,7 @@ int cmd_pack_objects(int argc,
 
        reset_pack_idx_option(&pack_idx_opts);
        pack_idx_opts.flags |= WRITE_REV;
-       git_config(git_pack_config, NULL);
+       repo_config(the_repository, git_pack_config, NULL);
        if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
                pack_idx_opts.flags &= ~WRITE_REV;
 
index 26f04b0..a659f00 100644 (file)
@@ -235,7 +235,7 @@ int cmd_patch_id(int argc,
                OPT_END()
        };
 
-       git_config(git_patch_id_config, &config);
+       repo_config(the_repository, git_patch_id_config, &config);
 
        /* verbatim implies stable */
        if (config.verbatim)
index c593f32..d13ed9b 100644 (file)
@@ -999,7 +999,7 @@ int cmd_pull(int argc,
        if (!getenv("GIT_REFLOG_ACTION"))
                set_reflog_message(argc, argv);
 
-       git_config(git_pull_config, NULL);
+       repo_config(the_repository, git_pull_config, NULL);
        if (the_repository->gitdir) {
                prepare_repo_settings(the_repository);
                the_repository->settings.command_requires_full_index = 0;
index 92d530e..d0794b7 100644 (file)
@@ -598,7 +598,7 @@ int cmd_push(int argc,
        };
 
        packet_trace_identity("push");
-       git_config(git_push_config, &flags);
+       repo_config(the_repository, git_push_config, &flags);
        argc = parse_options(argc, argv, prefix, options, push_usage, 0);
        push_options = (push_options_cmdline.nr
                ? &push_options_cmdline
index 32ddb66..a563abf 100644 (file)
@@ -54,7 +54,7 @@ int cmd_range_diff(int argc,
        struct object_id oid;
        const char *three_dots = NULL;
 
-       git_config(git_diff_ui_config, NULL);
+       repo_config(the_repository, git_diff_ui_config, NULL);
 
        repo_diff_setup(the_repository, &diffopt);
 
index a8f352f..00eef75 100644 (file)
@@ -168,7 +168,7 @@ int cmd_read_tree(int argc,
        opts.src_index = the_repository->index;
        opts.dst_index = the_repository->index;
 
-       git_config(git_read_tree_config, NULL);
+       repo_config(the_repository, git_read_tree_config, NULL);
 
        argc = parse_options(argc, argv, cmd_prefix, read_tree_options,
                             read_tree_usage, 0);
index e90562a..0c3daa4 100644 (file)
@@ -1245,7 +1245,7 @@ int cmd_rebase(int argc,
        prepare_repo_settings(the_repository);
        the_repository->settings.command_requires_full_index = 0;
 
-       git_config(rebase_config, &options);
+       repo_config(the_repository, rebase_config, &options);
        /* options.gpg_sign_opt will be either "-S" or NULL */
        gpg_sign = options.gpg_sign_opt ? "" : NULL;
        FREE_AND_NULL(options.gpg_sign_opt);
index 7974d15..82d516a 100644 (file)
@@ -2613,7 +2613,7 @@ int cmd_receive_pack(int argc,
        if (!enter_repo(service_dir, 0))
                die("'%s' does not appear to be a git repository", service_dir);
 
-       git_config(receive_pack_config, NULL);
+       repo_config(the_repository, receive_pack_config, NULL);
        if (cert_nonce_seed)
                push_cert_nonce = prepare_push_cert_nonce(service_dir, time(NULL));
 
index 3acaf3e..4312f3d 100644 (file)
@@ -202,7 +202,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
                OPT_END()
        };
 
-       git_config(reflog_expire_config, &opts);
+       repo_config(the_repository, reflog_expire_config, &opts);
 
        save_commit_buffer = 0;
        do_all = status = 0;
index 998d2a2..c7ad0a2 100644 (file)
@@ -88,7 +88,7 @@ static int cmd_refs_verify(int argc, const char **argv, const char *prefix,
        if (argc)
                usage(_("'git refs verify' takes no arguments"));
 
-       git_config(git_fsck_config, &fsck_refs_options);
+       repo_config(the_repository, git_fsck_config, &fsck_refs_options);
        prepare_repo_settings(the_repository);
 
        worktrees = get_worktrees_without_reading_head();
index 18843b6..ebd70be 100644 (file)
@@ -353,7 +353,7 @@ static void read_branches(void)
 {
        if (branch_list.nr)
                return;
-       git_config(config_read_branches, NULL);
+       repo_config(the_repository, config_read_branches, NULL);
 }
 
 struct ref_states {
@@ -690,7 +690,7 @@ static void handle_push_default(const char* old_name, const char* new_name)
                .origin = STRBUF_INIT,
                .linenr = -1,
        };
-       git_config(config_read_push_default, &push_default);
+       repo_config(the_repository, config_read_push_default, &push_default);
        if (push_default.scope >= CONFIG_SCOPE_COMMAND)
                ; /* pass */
        else if (push_default.scope >= CONFIG_SCOPE_LOCAL) {
@@ -1620,7 +1620,7 @@ static int update(int argc, const char **argv, const char *prefix,
                strvec_push(&cmd.args, argv[i]);
 
        if (strcmp(cmd.args.v[cmd.args.nr-1], "default") == 0) {
-               git_config(get_remote_default, &default_defined);
+               repo_config(the_repository, get_remote_default, &default_defined);
                if (!default_defined) {
                        strvec_pop(&cmd.args);
                        strvec_push(&cmd.args, "--all");
index b05ffe4..dd1db28 100644 (file)
@@ -1230,7 +1230,7 @@ int cmd_repack(int argc,
 
        list_objects_filter_init(&po_args.filter_options);
 
-       git_config(repack_config, &cruft_po_args);
+       repo_config(the_repository, repack_config, &cruft_po_args);
 
        argc = parse_options(argc, argv, prefix, builtin_repack_options,
                                git_repack_usage, 0);
index 5ff2ab7..3fe39e9 100644 (file)
@@ -574,7 +574,7 @@ int cmd_replace(int argc,
        };
 
        disable_replace_refs();
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
 
index 1312e79..a056cb7 100644 (file)
@@ -66,7 +66,7 @@ int cmd_rerere(int argc,
 
        argc = parse_options(argc, argv, prefix, options, rerere_usage, 0);
 
-       git_config(git_xmerge_config, NULL);
+       repo_config(the_repository, git_xmerge_config, NULL);
 
        if (autoupdate == 1)
                flags = RERERE_AUTOUPDATE;
index dc50ffc..00492c1 100644 (file)
@@ -377,7 +377,7 @@ int cmd_reset(int argc,
                OPT_END()
        };
 
-       git_config(git_reset_config, NULL);
+       repo_config(the_repository, git_reset_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, git_reset_usage,
                                                PARSE_OPT_KEEP_DASHDASH);
index 4d0c460..034ea0a 100644 (file)
@@ -636,7 +636,7 @@ int cmd_rev_list(int argc,
 
        show_usage_if_asked(argc, argv, rev_list_usage);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        repo_init_revisions(the_repository, &revs, prefix);
        revs.abbrev = DEFAULT_ABBREV;
        revs.commit_format = CMIT_FMT_UNSPECIFIED;
index 490da33..44ff1b8 100644 (file)
@@ -734,7 +734,7 @@ int cmd_rev_parse(int argc,
        /* No options; just report on whether we're in a git repo or not. */
        if (argc == 1) {
                setup_git_directory();
-               git_config(git_default_config, NULL);
+               repo_config(the_repository, git_default_config, NULL);
                return 0;
        }
 
@@ -769,7 +769,7 @@ int cmd_rev_parse(int argc,
                /* The rest of the options require a git repository. */
                if (!did_repo_setup) {
                        prefix = setup_git_directory();
-                       git_config(git_default_config, NULL);
+                       repo_config(the_repository, git_default_config, NULL);
                        did_repo_setup = 1;
 
                        prepare_repo_settings(the_repository);
index a6565a6..8c0da7a 100644 (file)
@@ -271,7 +271,7 @@ int cmd_rm(int argc,
        struct pathspec pathspec;
        char *seen;
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, builtin_rm_options,
                             builtin_rm_usage, 0);
index 60adc5e..b91acf4 100644 (file)
@@ -421,7 +421,7 @@ int cmd_shortlog(int argc,
        if (nongit && !the_hash_algo)
                repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        shortlog_init(&log);
        repo_init_revisions(the_repository, &rev, prefix);
        parse_options_start(&ctx, argc, argv, prefix, options,
index 525b231..1ab7db9 100644 (file)
@@ -710,7 +710,7 @@ int cmd_show_branch(int ac,
 
        init_commit_name_slab(&name_slab);
 
-       git_config(git_show_branch_config, NULL);
+       repo_config(the_repository, git_show_branch_config, NULL);
 
        /* If nothing is specified, try the default first */
        if (ac == 1 && default_args.nr) {
index 117709c..414e55b 100644 (file)
@@ -324,7 +324,7 @@ struct repository *repo UNUSED)
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, show_ref_options,
                             show_ref_usage, 0);
index 1bf0159..8c333b3 100644 (file)
@@ -1082,7 +1082,7 @@ int cmd_sparse_checkout(int argc,
                             builtin_sparse_checkout_options,
                             builtin_sparse_checkout_usage, 0);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        prepare_repo_settings(the_repository);
        the_repository->settings.command_requires_full_index = 0;
index e2f95cc..821b58a 100644 (file)
@@ -979,7 +979,7 @@ static int show_stash(int argc, const char **argv, const char *prefix,
        int do_usage = 0;
 
        init_diff_ui_defaults();
-       git_config(git_diff_ui_config, NULL);
+       repo_config(the_repository, git_diff_ui_config, NULL);
        repo_init_revisions(the_repository, &rev, prefix);
 
        argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
@@ -2358,7 +2358,7 @@ int cmd_stash(int argc,
        const char **args_copy;
        int ret;
 
-       git_config(git_stash_config, NULL);
+       repo_config(the_repository, git_stash_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, git_stash_usage,
                             PARSE_OPT_SUBCOMMAND_OPTIONAL |
index e147f3f..4a566cb 100644 (file)
@@ -55,7 +55,7 @@ int cmd_stripspace(int argc,
 
        if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
                setup_git_directory_gently(&nongit);
-               git_config(git_default_config, NULL);
+               repo_config(the_repository, git_default_config, NULL);
        }
 
        if (strbuf_read(&buf, 0, 1024) < 0)
index d8a6fa4..89ee09a 100644 (file)
@@ -649,7 +649,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
                     "--ignore-submodules=dirty", "--quiet", "--",
                     path, NULL);
 
-       git_config(git_diff_basic_config, NULL);
+       repo_config(the_repository, git_diff_basic_config, NULL);
 
        repo_init_revisions(the_repository, &rev, NULL);
        rev.abbrev = 0;
@@ -1108,7 +1108,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
        if (info->argc)
                strvec_pushv(&diff_args, info->argv);
 
-       git_config(git_diff_basic_config, NULL);
+       repo_config(the_repository, git_diff_basic_config, NULL);
        repo_init_revisions(the_repository, &rev, info->prefix);
        rev.abbrev = 0;
        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,
        };
 
        update_clone_config_from_gitmodules(&opt.max_jobs);
-       git_config(git_update_clone_config, &opt.max_jobs);
+       repo_config(the_repository, git_update_clone_config, &opt.max_jobs);
 
        argc = parse_options(argc, argv, prefix, module_update_options,
                             git_submodule_helper_usage, 0);
@@ -3128,7 +3128,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix,
                NULL
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        track = git_branch_track;
        argc = parse_options(argc, argv, prefix, options, usage, 0);
 
index 299d23d..5c46230 100644 (file)
@@ -59,7 +59,7 @@ int cmd_symbolic_ref(int argc,
                OPT_END(),
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, options,
                             git_symbolic_ref_usage, 0);
        if (msg && !*msg)
index 46cbf89..25f30e3 100644 (file)
@@ -546,7 +546,7 @@ int cmd_tag(int argc,
         * Try to set sort keys from config. If config does not set any,
         * fall back on default (refname) sorting.
         */
-       git_config(git_tag_config, &sorting_options);
+       repo_config(the_repository, git_tag_config, &sorting_options);
        if (!sorting_options.nr)
                string_list_append(&sorting_options, "refname");
 
index 4360872..ae871ad 100644 (file)
@@ -43,7 +43,7 @@ int cmd_unpack_file(int argc,
        if (repo_get_oid(the_repository, argv[1], &oid))
                die("Not a valid object name %s", argv[1]);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        puts(create_temp_file(&oid));
        return 0;
index a69d59e..26aa885 100644 (file)
@@ -621,7 +621,7 @@ int cmd_unpack_objects(int argc,
 
        disable_replace_refs();
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        quiet = !isatty(2);
 
index 0c1d4ed..2380f3c 100644 (file)
@@ -1103,7 +1103,7 @@ int cmd_update_index(int argc,
        show_usage_with_options_if_asked(argc, argv,
                                         update_index_usage, options);
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        prepare_repo_settings(r);
        the_repository->settings.command_requires_full_index = 0;
index 1e6131e..cb93664 100644 (file)
@@ -769,7 +769,7 @@ int cmd_update_ref(int argc,
                OPT_END(),
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, options, git_update_ref_usage,
                             0);
        if (msg && !*msg)
index ada642a..beeac12 100644 (file)
@@ -226,11 +226,11 @@ int cmd_var(int argc,
                usage(var_usage);
 
        if (strcmp(argv[1], "-l") == 0) {
-               git_config(show_config, NULL);
+               repo_config(the_repository, show_config, NULL);
                list_vars();
                return 0;
        }
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        git_var = get_git_var(argv[1]);
        if (!git_var)
index 34e4ed7..d9f66f5 100644 (file)
@@ -81,7 +81,7 @@ int cmd_verify_pack(int argc,
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, prefix, verify_pack_options,
                             verify_pack_usage, 0);
        if (argc < 1)
index 2dceeee..b130624 100644 (file)
@@ -1448,7 +1448,7 @@ int cmd_worktree(int ac,
                OPT_END()
        };
 
-       git_config(git_worktree_config, NULL);
+       repo_config(the_repository, git_worktree_config, NULL);
 
        if (!prefix)
                prefix = "";
index cfec044..3465c70 100644 (file)
@@ -43,7 +43,7 @@ int cmd_write_tree(int argc,
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        argc = parse_options(argc, argv, cmd_prefix, write_tree_options,
                             write_tree_usage, 0);
 
index 29a0277..6b729fc 100644 (file)
--- a/config.h
+++ b/config.h
@@ -719,11 +719,6 @@ NORETURN void git_die_config_linenr(const char *key, const char *filename, int l
 int lookup_config(const char **mapping, int nr_mapping, const char *var);
 
 # ifdef USE_THE_REPOSITORY_VARIABLE
-static inline void git_config(config_fn_t fn, void *data)
-{
-       repo_config(the_repository, fn, data);
-}
-
 static inline void git_config_clear(void)
 {
        repo_config_clear(the_repository);
index e77287f..4b1dc65 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -1028,7 +1028,7 @@ static int git_proxy_command_options(const char *var, const char *value,
 static int git_use_proxy(const char *host)
 {
        git_proxy_command = getenv("GIT_PROXY_COMMAND");
-       git_config(git_proxy_command_options, (void*)host);
+       repo_config(the_repository, git_proxy_command_options, (void*)host);
        return (git_proxy_command && *git_proxy_command);
 }
 
index 6d3d100..54f09fc 100644 (file)
@@ -83,7 +83,7 @@ int fn(const char *C1, const char *C2,
 
 
 // The previous rules don't catch all callbacks, especially if they're defined
-// in a separate file from the git_config() call. Fix these manually.
+// in a separate file from the repo_config() call. Fix these manually.
 @@
 identifier C1, C2, D;
 attribute name UNUSED;
index b5f7cf6..c7d6a85 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1326,7 +1326,7 @@ void convert_attrs(struct index_state *istate,
                                         "eol", "text", "working-tree-encoding",
                                         NULL);
                user_convert_tail = &user_convert;
-               git_config(read_convert_config, NULL);
+               repo_config(the_repository, read_convert_config, NULL);
        }
 
        git_check_attr(istate, path, check);
index 01d3699..1134420 100644 (file)
@@ -1916,7 +1916,7 @@ static void fetch_pack_config(void)
                }
        }
 
-       git_config(fetch_pack_config_cb, NULL);
+       repo_config(the_repository, fetch_pack_config_cb, NULL);
 }
 
 static void fetch_pack_setup(void)
diff --git a/fsck.h b/fsck.h
index 0c5869a..dd7df3d 100644 (file)
--- a/fsck.h
+++ b/fsck.h
@@ -287,7 +287,7 @@ const char *fsck_describe_object(struct fsck_options *options,
 
 struct key_value_info;
 /*
- * git_config() callback for use by fsck-y tools that want to support
+ * repo_config() callback for use by fsck-y tools that want to support
  * fsck.<msg> fsck.skipList etc.
  */
 int git_fsck_config(const char *var, const char *value,
index bdcc8c2..bc0c21e 100644 (file)
@@ -25,7 +25,7 @@ static void gpg_interface_lazy_init(void)
        if (done)
                return;
        done = 1;
-       git_config(git_gpg_config, NULL);
+       repo_config(the_repository, git_gpg_config, NULL);
 }
 
 static char *configured_signing_key;
diff --git a/help.c b/help.c
index 652efeb..db62cda 100644 (file)
--- a/help.c
+++ b/help.c
@@ -332,7 +332,7 @@ static int get_colopts(const char *var, const char *value,
 void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
 {
        unsigned int colopts = 0;
-       git_config(get_colopts, &colopts);
+       repo_config(the_repository, get_colopts, &colopts);
 
        if (main_cmds->cnt) {
                const char *exec_path = git_exec_path();
@@ -502,7 +502,7 @@ static void list_all_cmds_help_aliases(int longest)
        struct cmdname_help *aliases;
        int i;
 
-       git_config(get_alias, &alias_list);
+       repo_config(the_repository, get_alias, &alias_list);
        string_list_sort(&alias_list);
 
        for (i = 0; i < alias_list.nr; i++) {
index 02ab805..17b9fe4 100644 (file)
@@ -150,7 +150,7 @@ int cmd_main(int argc, const char **argv)
 
        trace2_cmd_name("http-fetch");
 
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        if (packfile) {
                if (!index_pack_args.nr)
diff --git a/http.c b/http.c
index 9b62f62..d94e8f6 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1315,7 +1315,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
        http_is_verbose = 0;
        normalized_url = url_normalize(url, &config.url);
 
-       git_config(urlmatch_config_entry, &config);
+       repo_config(the_repository, urlmatch_config_entry, &config);
        free(normalized_url);
        string_list_clear(&config.vars, 1);
 
index f5a656a..9b26c66 100644 (file)
@@ -1776,7 +1776,7 @@ int cmd_main(int argc, const char **argv)
        int ret;
 
        setup_git_directory_gently(&nongit_ok);
-       git_config(git_imap_config, &server);
+       repo_config(the_repository, git_imap_config, &server);
 
        argc = parse_options(argc, (const char **)argv, "", imap_send_options, imap_send_usage, 0);
 
index e28c841..c47acde 100644 (file)
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -159,7 +159,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
        strbuf_init(&data.buf, 0);
        strvec_init(&data.hidden_refs);
 
-       git_config(ls_refs_config, &data);
+       repo_config(the_repository, ls_refs_config, &data);
 
        while (packet_reader_read(request) == PACKET_READ_NORMAL) {
                const char *arg = request->line;
index b2dc26d..fafe2c9 100644 (file)
@@ -357,7 +357,7 @@ static void initialize_ll_merge(void)
        if (ll_user_merge_tail)
                return;
        ll_user_merge_tail = &ll_user_merge;
-       git_config(read_merge_config, NULL);
+       repo_config(the_repository, read_merge_config, NULL);
 }
 
 static const struct ll_merge_driver *find_ll_merge_driver(const char *merge_attr)
index 473ff61..49aa37a 100644 (file)
@@ -5387,7 +5387,7 @@ static void merge_recursive_config(struct merge_options *opt, int ui)
                        free(value);
                }
        }
-       git_config(git_xmerge_config, NULL);
+       repo_config(the_repository, git_xmerge_config, NULL);
 }
 
 static void init_merge_options(struct merge_options *opt,
index ac66b82..6a50c6d 100644 (file)
@@ -162,7 +162,7 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)
                c->refs_from_env = 1;
                string_list_add_refs_from_colon_sep(c->refs, rewrite_refs_env);
        }
-       git_config(notes_rewrite_config, c);
+       repo_config(the_repository, notes_rewrite_config, c);
        if (!c->enabled || !c->refs->nr) {
                string_list_clear(c->refs, 0);
                free(c->refs);
diff --git a/notes.c b/notes.c
index 97b995f..49393fb 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -1123,7 +1123,7 @@ void load_display_notes(struct display_notes_opt *opt)
                        load_config_refs = 1;
        }
 
-       git_config(notes_display_config, &load_config_refs);
+       repo_config(the_repository, notes_display_config, &load_config_refs);
 
        if (opt) {
                struct string_list_item *item;
index 0bc8ad8..cee96b9 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -141,7 +141,7 @@ static void setup_commit_formats(void)
        COPY_ARRAY(commit_formats, builtin_formats,
                   ARRAY_SIZE(builtin_formats));
 
-       git_config(git_pretty_formats_config, NULL);
+       repo_config(the_repository, git_pretty_formats_config, NULL);
 }
 
 static struct cmt_fmt_map *find_commit_format_recursive(const char *sought,
index 4c3817f..5134781 100644 (file)
@@ -386,7 +386,7 @@ static struct ref_store *reftable_be_init(struct repository *repo,
        refs->write_options.lock_timeout_ms = 100;
        refs->write_options.fsync = reftable_be_fsync;
 
-       git_config(reftable_be_config, &refs->write_options);
+       repo_config(the_repository, reftable_be_config, &refs->write_options);
 
        /*
         * It is somewhat unfortunate that we have to mirror the default block
index 8bb97c9..1ac2075 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -879,7 +879,7 @@ static void git_rerere_config(void)
 {
        git_config_get_bool("rerere.enabled", &rerere_enabled);
        git_config_get_bool("rerere.autoupdate", &rerere_autoupdate);
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 }
 
 static GIT_PATH_FUNC(git_path_rr_cache, "rr-cache")
@@ -1247,7 +1247,7 @@ void rerere_gc(struct repository *r, struct string_list *rr)
                                       &cutoff_resolve, now);
        repo_config_get_expiry_in_days(the_repository, "gc.rerereunresolved",
                                       &cutoff_noresolve, now);
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
        dir = opendir(repo_git_path_replace(the_repository, &buf, "rr-cache"));
        if (!dir)
                die_errno(_("unable to open rr-cache directory"));
index 0ca6a29..ad63c10 100644 (file)
@@ -1636,7 +1636,7 @@ void exclude_hidden_refs(struct ref_exclusions *exclusions, const char *section)
        cb.exclusions = exclusions;
        cb.section = section;
 
-       git_config(hide_refs_config, &cb);
+       repo_config(the_repository, hide_refs_config, &cb);
 }
 
 struct all_refs_cb {
index 0dc79fa..3b713ab 100644 (file)
--- a/scalar.c
+++ b/scalar.c
@@ -713,7 +713,7 @@ static int cmd_reconfigure(int argc, const char **argv)
                            maintenance_str);
        }
 
-       git_config(get_scalar_repos, &scalar_repos);
+       repo_config(the_repository, get_scalar_repos, &scalar_repos);
 
        for (size_t i = 0; i < scalar_repos.nr; i++) {
                int succeeded = 0;
index 67e4310..df207f3 100644 (file)
@@ -327,7 +327,7 @@ static int git_sequencer_config(const char *k, const char *v,
 void sequencer_init_config(struct replay_opts *opts)
 {
        opts->default_msg_cleanup = COMMIT_MSG_CLEANUP_NONE;
-       git_config(git_sequencer_config, opts);
+       repo_config(the_repository, git_sequencer_config, opts);
 }
 
 static inline int is_rebase_i(const struct replay_opts *opts)
diff --git a/setup.c b/setup.c
index 6f52dab..91a3aff 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -2339,7 +2339,7 @@ static int create_default_files(const char *template_path,
        copy_templates(template_path);
        git_config_clear();
        repo_settings_reset_shared_repository(the_repository);
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        reinit = is_reinit();
 
@@ -2610,7 +2610,7 @@ int init_db(const char *git_dir, const char *real_git_dir,
         * have set up the repository format such that we can evaluate
         * includeIf conditions correctly in the case of re-initialization.
         */
-       git_config(platform_core_config, NULL);
+       repo_config(the_repository, platform_core_config, NULL);
 
        safe_create_dir(the_repository, git_dir, 0);
 
index 6967c8e..77c15a4 100644 (file)
@@ -11,7 +11,7 @@ int cmd__advise_if_enabled(int argc, const char **argv)
                die("usage: %s <advice>", argv[0]);
 
        setup_git_directory();
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        /*
         * Any advice type can be used for testing, but NESTED_TAG was
index 75e028a..41ba864 100644 (file)
  *                             ascending order of priority from a config_set
  *                             constructed from files entered as arguments.
  *
- * iterate -> iterate over all values using git_config(), and print some
+ * iterate -> iterate over all values using repo_config(), and print some
  *            data for each
  *
- * git_config_int -> iterate over all values using git_config() and print the
+ * git_config_int -> iterate over all values using repo_config() and print the
  *                   integer value for the entered key or die
  *
  * Examples:
@@ -218,10 +218,10 @@ int cmd__config(int argc, const char **argv)
                        goto exit1;
                }
        } else if (!strcmp(argv[1], "iterate")) {
-               git_config(iterate_cb, NULL);
+               repo_config(the_repository, iterate_cb, NULL);
                goto exit0;
        } else if (argc == 3 && !strcmp(argv[1], "git_config_int")) {
-               git_config(parse_int_cb, (void *) argv[2]);
+               repo_config(the_repository, parse_int_cb, (void *) argv[2]);
                goto exit0;
        }
 
index e277dde..b2da48e 100644 (file)
@@ -19,7 +19,7 @@ int cmd__read_cache(int argc, const char **argv)
        if (argc == 2)
                cnt = strtol(argv[1], NULL, 0);
        setup_git_directory();
-       git_config(git_default_config, NULL);
+       repo_config(the_repository, git_default_config, NULL);
 
        for (i = 0; i < cnt; i++) {
                repo_read_index(the_repository);
index 94c48ab..aa3a989 100644 (file)
@@ -41,7 +41,7 @@ int cmd__userdiff(int argc, const char **argv)
 
        if (want & USERDIFF_DRIVER_TYPE_CUSTOM) {
                setup_git_directory();
-               git_config(cmd__userdiff_config, NULL);
+               repo_config(the_repository, cmd__userdiff_config, NULL);
        }
 
        for_each_userdiff_driver(driver_cb, &want);
index b395adb..39caeba 100644 (file)
@@ -1214,7 +1214,7 @@ void setup_mailinfo(struct mailinfo *mi)
        mi->header_stage = 1;
        mi->use_inbody_headers = 1;
        mi->content_top = mi->content;
-       git_config(git_mailinfo_config, mi);
+       repo_config(the_repository, git_mailinfo_config, mi);
 }
 
 void clear_mailinfo(struct mailinfo *mi)
index 3281a37..b76eb86 100644 (file)
@@ -1154,7 +1154,7 @@ void setup_mailinfo(struct mailinfo *mi)
        mi->header_stage = 1;
        mi->use_inbody_headers = 1;
        mi->content_top = mi->content;
-       git_config(git_mailinfo_config, mi);
+       repo_config(the_repository, git_mailinfo_config, mi);
 }
 
 void clear_mailinfo(struct mailinfo *mi)
index 310cf58..911a81e 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -595,8 +595,8 @@ void trailer_config_init(void)
        default_conf_info.where = WHERE_END;
        default_conf_info.if_exists = EXISTS_ADD_IF_DIFFERENT_NEIGHBOR;
        default_conf_info.if_missing = MISSING_ADD;
-       git_config(git_trailer_default_config, NULL);
-       git_config(git_trailer_config, NULL);
+       repo_config(the_repository, git_trailer_default_config, NULL);
+       repo_config(the_repository, git_trailer_config, NULL);
        configured = 1;
 }
 
index c123ac1..a246afd 100644 (file)
@@ -202,7 +202,7 @@ static int fetch_refs_from_bundle(struct transport *transport,
        if (!data->get_refs_from_bundle_called)
                get_refs_from_bundle_inner(transport);
 
-       git_config(fetch_fsck_config_cb, &msg_types);
+       repo_config(the_repository, fetch_fsck_config_cb, &msg_types);
        opts.fsck_msg_types = msg_types.buf;
 
        ret = unbundle(the_repository, &data->header, data->fd,