config: drop `git_config()` wrapper

In 036876a106 (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>
maint
Patrick Steinhardt 2025-07-23 16:08:22 +02:00 committed by Junio C Hamano
parent 86c9c14eb9
commit 9ce196e86b
118 changed files with 148 additions and 153 deletions

View File

@ -4270,7 +4270,7 @@ So, look into `builtin/cat-file.c`, search for `cmd_cat_file()` and look what
it does. it does.


------------------------------------------------------------------ ------------------------------------------------------------------
git_config(git_default_config); repo_config(the_repository, git_default_config);
if (argc != 3) if (argc != 3)
usage("git cat-file [-t|-s|-e|-p|<type>] <sha1>"); usage("git cat-file [-t|-s|-e|-p|<type>] <sha1>");
if (get_sha1(argv[2], sha1)) if (get_sha1(argv[2], sha1))

View File

@ -50,7 +50,7 @@ static void git_apply_config(void)
{ {
git_config_get_string("apply.whitespace", &apply_default_whitespace); git_config_get_string("apply.whitespace", &apply_default_whitespace);
git_config_get_string("apply.ignorewhitespace", &apply_default_ignorewhitespace); 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) static int parse_whitespace_option(struct apply_state *state, const char *option)

View File

@ -537,7 +537,7 @@ void init_tar_archiver(void)
tar_filter_config("tar.tgz.remote", "true", NULL); 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.command", internal_gzip_command, NULL);
tar_filter_config("tar.tar.gz.remote", "true", 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++) { for (i = 0; i < nr_tar_filters; i++) {
/* omit any filters that never had a command configured */ /* omit any filters that never had a command configured */
if (tar_filters[i]->filter_command) if (tar_filters[i]->filter_command)

View File

@ -632,7 +632,7 @@ static int write_zip_archive(const struct archiver *ar UNUSED,
{ {
int err; int err;


git_config(archive_zip_config, NULL); repo_config(the_repository, archive_zip_config, NULL);


dos_time(&args->time, &zip_date, &zip_time); dos_time(&args->time, &zip_date, &zip_time);



View File

@ -761,7 +761,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
int rc; int rc;


git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable); 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; describe_status.max_invocations = 1;
ctx.date_mode.type = DATE_NORMAL; ctx.date_mode.type = DATE_NORMAL;

View File

@ -2445,7 +2445,7 @@ int cmd_am(int argc,


show_usage_with_options_if_asked(argc, argv, usage, options); 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); am_state_init(&state);



View File

@ -947,7 +947,7 @@ int cmd_blame(int argc,
const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage; const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;


setup_default_color_by_age(); 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); repo_init_revisions(the_repository, &revs, NULL);
revs.date_mode = blame_date_mode; revs.date_mode = blame_date_mode;
revs.diffopt.flags.allow_textconv = 1; revs.diffopt.flags.allow_textconv = 1;

View File

@ -791,7 +791,7 @@ int cmd_branch(int argc,
* Try to set sort keys from config. If config does not set any, * Try to set sort keys from config. If config does not set any,
* fall back on default (refname) sorting. * 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) if (!sorting_options.nr)
string_list_append(&sorting_options, "refname"); string_list_append(&sorting_options, "refname");



View File

@ -1095,7 +1095,7 @@ int cmd_cat_file(int argc,
OPT_END() OPT_END()
}; };


git_config(git_cat_file_config, NULL); repo_config(the_repository, git_cat_file_config, NULL);


batch.buffer_output = -1; batch.buffer_output = -1;



View File

@ -119,7 +119,7 @@ int cmd_check_attr(int argc,
if (!is_bare_repository()) if (!is_bare_repository())
setup_work_tree(); 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, argc = parse_options(argc, argv, prefix, check_attr_options,
check_attr_usage, PARSE_OPT_KEEP_DASHDASH); check_attr_usage, PARSE_OPT_KEEP_DASHDASH);

View File

@ -159,7 +159,7 @@ int cmd_check_ignore(int argc,
int num_ignored; int num_ignored;
struct dir_struct dir = DIR_INIT; 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, argc = parse_options(argc, argv, prefix, check_ignore_options,
check_ignore_usage, 0); check_ignore_usage, 0);

View File

@ -56,7 +56,7 @@ int cmd_check_mailmap(int argc,
int i; int i;
struct string_list mailmap = STRING_LIST_INIT_NODUP; 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, argc = parse_options(argc, argv, prefix, check_mailmap_options,
check_mailmap_usage, 0); check_mailmap_usage, 0);
if (argc == 0 && !use_stdin) if (argc == 0 && !use_stdin)

View File

@ -132,7 +132,7 @@ int cmd_checkout__worker(int argc,
checkout_worker_usage, checkout_worker_usage,
checkout_worker_options); 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, argc = parse_options(argc, argv, prefix, checkout_worker_options,
checkout_worker_usage, 0); checkout_worker_usage, 0);
if (argc > 0) if (argc > 0)

View File

@ -1764,7 +1764,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
opts->prefix = prefix; opts->prefix = prefix;
opts->show_progress = -1; opts->show_progress = -1;


git_config(git_checkout_config, opts); repo_config(the_repository, git_checkout_config, opts);
if (the_repository->gitdir) { if (the_repository->gitdir) {
prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -949,7 +949,7 @@ int cmd_clean(int argc,
OPT_END() 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, argc = parse_options(argc, argv, prefix, options, builtin_clean_usage,
0); 0);

View File

@ -1001,7 +1001,7 @@ int cmd_clone(int argc,


packet_trace_identity("clone"); 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, argc = parse_options(argc, argv, prefix, builtin_clone_options,
builtin_clone_usage, 0); 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 * re-read config after init_db and write_config to pick up any config
* injected by --template and --config, respectively. * 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, * If option_reject_shallow is specified from CLI option,

View File

@ -42,9 +42,9 @@ int cmd_column(int argc,
/* This one is special and must be the first one */ /* This one is special and must be the first one */
if (argc > 1 && starts_with(argv[1], "--command=")) { if (argc > 1 && starts_with(argv[1], "--command=")) {
command = argv[1] + 10; command = argv[1] + 10;
git_config(column_config, (void *)command); repo_config(the_repository, column_config, (void *)command);
} else } else
git_config(column_config, NULL); repo_config(the_repository, column_config, NULL);


memset(&copts, 0, sizeof(copts)); memset(&copts, 0, sizeof(copts));
copts.padding = 1; copts.padding = 1;

View File

@ -265,7 +265,7 @@ static int graph_write(int argc, const char **argv, const char *prefix,


trace2_cmd_mode("write"); 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, argc = parse_options(argc, argv, prefix,
options, options,
@ -347,7 +347,7 @@ int cmd_commit_graph(int argc,
}; };
struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts); 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(); disable_replace_refs();
save_commit_buffer = 0; save_commit_buffer = 0;

View File

@ -125,7 +125,7 @@ int cmd_commit_tree(int argc,
}; };
int ret; int ret;


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


show_usage_with_options_if_asked(argc, argv, show_usage_with_options_if_asked(argc, argv,
commit_tree_usage, options); commit_tree_usage, options);

View File

@ -207,9 +207,9 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)
{ {
wt_status_prepare(the_repository, s); wt_status_prepare(the_repository, s);
init_diff_ui_defaults(); init_diff_ui_defaults();
git_config(fn, s); repo_config(the_repository, fn, s);
determine_whence(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) static void rollback_index_files(void)

View File

@ -1091,7 +1091,7 @@ static int show_editor(struct config_location_options *opts)
die(_("editing stdin is not supported")); die(_("editing stdin is not supported"));
if (opts->source.blob) if (opts->source.blob)
die(_("editing blobs is not supported")); 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 ? config_file = opts->source.file ?
xstrdup(opts->source.file) : xstrdup(opts->source.file) :
repo_git_path(the_repository, "config"); repo_git_path(the_repository, "config");

View File

@ -106,7 +106,7 @@ int cmd_count_objects(int argc,
OPT_END(), 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); argc = parse_options(argc, argv, prefix, opts, count_objects_usage, 0);
/* we do not take arguments other than flags for now */ /* we do not take arguments other than flags for now */

View File

@ -16,7 +16,7 @@ int cmd_credential(int argc,
const char *op; const char *op;
struct credential c = CREDENTIAL_INIT; 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); show_usage_if_asked(argc, argv, usage_msg);
if (argc != 2) if (argc != 2)

View File

@ -623,7 +623,7 @@ int cmd_describe(int argc,
OPT_END(), 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); argc = parse_options(argc, argv, prefix, options, describe_usage, 0);
if (abbrev < 0) if (abbrev < 0)
abbrev = DEFAULT_ABBREV; abbrev = DEFAULT_ABBREV;

View File

@ -31,7 +31,7 @@ int cmd_diff_files(int argc,


show_usage_if_asked(argc, argv, diff_files_usage); 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); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -28,7 +28,7 @@ int cmd_diff_index(int argc,


show_usage_if_asked(argc, argv, diff_cache_usage); 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); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -124,7 +124,7 @@ int cmd_diff_tree(int argc,


show_usage_if_asked(argc, argv, diff_tree_usage); 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); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -486,7 +486,7 @@ int cmd_diff(int argc,
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT); repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);


init_diff_ui_defaults(); 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); prefix = precompose_argv_prefix(argc, argv, prefix);


repo_init_revisions(the_repository, &rev, prefix); repo_init_revisions(the_repository, &rev, prefix);

View File

@ -1327,7 +1327,7 @@ int cmd_fast_export(int argc,
usage_with_options (fast_export_usage, options); usage_with_options (fast_export_usage, options);


/* we handle encodings */ /* we handle encodings */
git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


repo_init_revisions(the_repository, &revs, prefix); repo_init_revisions(the_repository, &revs, prefix);
init_revision_sources(&revision_sources); init_revision_sources(&revision_sources);

View File

@ -3541,7 +3541,7 @@ static void git_pack_config(void)
else if (!git_config_get_int("transfer.unpacklimit", &limit)) else if (!git_config_get_int("transfer.unpacklimit", &limit))
unpack_limit = limit; unpack_limit = limit;


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);
} }


static const char fast_import_usage[] = static const char fast_import_usage[] =

View File

@ -1995,7 +1995,7 @@ static int add_remote_or_group(const char *name, struct string_list *list)
struct remote_group_data g; struct remote_group_data g;
g.name = name; g.list = list; 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) { if (list->nr == prev_nr) {
struct remote *remote = remote_get(name); struct remote *remote = remote_get(name);
if (!remote_is_configured(remote, 0)) if (!remote_is_configured(remote, 0))
@ -2417,7 +2417,7 @@ int cmd_fetch(int argc,
free(anon); free(anon);
} }


git_config(git_fetch_config, &config); repo_config(the_repository, git_fetch_config, &config);
if (the_repository->gitdir) { if (the_repository->gitdir) {
prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -53,7 +53,7 @@ int cmd_fmt_merge_msg(int argc,
int ret; int ret;
struct fmt_merge_msg_opts opts; 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, argc = parse_options(argc, argv, prefix, options, fmt_merge_msg_usage,
0); 0);
if (argc > 0) if (argc > 0)

View File

@ -987,7 +987,7 @@ int cmd_fsck(int argc,
if (name_objects) if (name_objects)
fsck_enable_object_names(&fsck_walk_options); 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); prepare_repo_settings(the_repository);


if (check_references) if (check_references)

View File

@ -1547,7 +1547,7 @@ int cmd_fsmonitor__daemon(int argc,
OPT_END() OPT_END()
}; };


git_config(fsmonitor_config, NULL); repo_config(the_repository, fsmonitor_config, NULL);


argc = parse_options(argc, argv, prefix, options, argc = parse_options(argc, argv, prefix, options,
builtin_fsmonitor__daemon_usage, 0); builtin_fsmonitor__daemon_usage, 0);

View File

@ -228,7 +228,7 @@ static void gc_config(struct gc_config *cfg)
cfg->repack_filter_to = owned; cfg->repack_filter_to = owned;
} }


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);
} }


enum schedule_priority { enum schedule_priority {

View File

@ -1035,7 +1035,7 @@ int cmd_grep(int argc,
grep_prefix = prefix; grep_prefix = prefix;


grep_init(&opt, the_repository); 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 * If there is no -- then the paths must exist in the working

View File

@ -111,7 +111,7 @@ int cmd_hash_object(int argc,
vpath = vpath_free; vpath = vpath_free;
} }


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


if (stdin_paths) { if (stdin_paths) {
if (hashstdin) if (hashstdin)

View File

@ -210,7 +210,7 @@ static enum help_format parse_help_format(const char *format)
if (!strcmp(format, "web") || !strcmp(format, "html")) if (!strcmp(format, "web") || !strcmp(format, "html"))
return HELP_FORMAT_WEB; 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. * add new help formats.
*/ */
die(_("unrecognized help format '%s'"), format); die(_("unrecognized help format '%s'"), format);
@ -706,7 +706,7 @@ int cmd_help(int argc,
} }


setup_git_directory_gently(&nongit); 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) if (parsed_help_format != HELP_FORMAT_NONE)
help_format = parsed_help_format; help_format = parsed_help_format;

View File

@ -55,7 +55,7 @@ static int run(int argc, const char **argv, const char *prefix,
strvec_push(&opt.args, argv[i]); strvec_push(&opt.args, argv[i]);


/* Need to take into account core.hooksPath */ /* 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]; hook_name = argv[0];
if (!ignore_missing) if (!ignore_missing)

View File

@ -1917,7 +1917,7 @@ int cmd_index_pack(int argc,


reset_pack_idx_option(&opts); reset_pack_idx_option(&opts);
opts.flags |= WRITE_REV; opts.flags |= WRITE_REV;
git_config(git_index_pack_config, &opts); repo_config(the_repository, git_index_pack_config, &opts);
if (prefix && chdir(prefix)) if (prefix && chdir(prefix))
die(_("Cannot come back to cwd")); die(_("Cannot come back to cwd"));



View File

@ -220,7 +220,7 @@ int cmd_interpret_trailers(int argc,
OPT_END() OPT_END()
}; };


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


argc = parse_options(argc, argv, prefix, options, argc = parse_options(argc, argv, prefix, options,
git_interpret_trailers_usage, 0); git_interpret_trailers_usage, 0);

View File

@ -659,10 +659,10 @@ int cmd_whatchanged(int argc,


log_config_init(&cfg); log_config_init(&cfg);
init_diff_ui_defaults(); 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); 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.diff = 1;
rev.simplify_history = 0; rev.simplify_history = 0;
@ -790,7 +790,7 @@ int cmd_show(int argc,


log_config_init(&cfg); log_config_init(&cfg);
init_diff_ui_defaults(); init_diff_ui_defaults();
git_config(git_log_config, &cfg); repo_config(the_repository, git_log_config, &cfg);


if (the_repository->gitdir) { if (the_repository->gitdir) {
prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);
@ -799,7 +799,7 @@ int cmd_show(int argc,


memset(&match_all, 0, sizeof(match_all)); memset(&match_all, 0, sizeof(match_all));
repo_init_revisions(the_repository, &rev, prefix); 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.diff = 1;
rev.always_show_header = 1; rev.always_show_header = 1;
@ -907,11 +907,11 @@ int cmd_log_reflog(int argc,


log_config_init(&cfg); log_config_init(&cfg);
init_diff_ui_defaults(); 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); repo_init_revisions(the_repository, &rev, prefix);
init_reflog_walk(&rev.reflog_info); 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; rev.verbose_header = 1;
memset(&opt, 0, sizeof(opt)); memset(&opt, 0, sizeof(opt));
@ -952,10 +952,10 @@ int cmd_log(int argc,


log_config_init(&cfg); log_config_init(&cfg);
init_diff_ui_defaults(); 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); 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; rev.always_show_header = 1;
memset(&opt, 0, sizeof(opt)); memset(&opt, 0, sizeof(opt));
@ -2158,9 +2158,9 @@ int cmd_format_patch(int argc,
format_config_init(&cfg); format_config_init(&cfg);
init_diff_ui_defaults(); init_diff_ui_defaults();
init_display_notes(&cfg.notes_opt); 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); 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; rev.show_notes = cfg.show_notes;
memcpy(&rev.notes_opt, &cfg.notes_opt, sizeof(cfg.notes_opt)); memcpy(&rev.notes_opt, &cfg.notes_opt, sizeof(cfg.notes_opt));

View File

@ -375,7 +375,7 @@ int cmd_ls_tree(int argc,
struct object_context obj_context = {0}; struct object_context obj_context = {0};
int ret; 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, argc = parse_options(argc, argv, prefix, ls_tree_options,
ls_tree_usage, 0); ls_tree_usage, 0);

View File

@ -167,7 +167,7 @@ int cmd_merge_base(int argc,
OPT_END() 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); argc = parse_options(argc, argv, prefix, options, merge_base_usage, 0);


if (cmdmode == 'a') { if (cmdmode == 'a') {

View File

@ -97,7 +97,7 @@ int cmd_merge_file(int argc,


if (startup_info->have_repository) { if (startup_info->have_repository) {
/* Read the configuration file */ /* Read the configuration file */
git_config(git_xmerge_config, NULL); repo_config(the_repository, git_xmerge_config, NULL);
if (0 <= git_xmerge_style) if (0 <= git_xmerge_style)
xmp.style = git_xmerge_style; xmp.style = git_xmerge_style;
} }

View File

@ -683,7 +683,7 @@ int cmd_merge_tree(int argc,
if (argc != expected_remaining_argc) if (argc != expected_remaining_argc)
usage_with_options(merge_tree_usage, mt_options); 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 */ /* Do the relevant type of merge */
if (o.mode == MODE_REAL) if (o.mode == MODE_REAL)

View File

@ -1392,7 +1392,7 @@ int cmd_merge(int argc,
skip_prefix(branch, "refs/heads/", &branch); skip_prefix(branch, "refs/heads/", &branch);


init_diff_ui_defaults(); 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)) if (!branch || is_null_oid(&head_oid))
head_commit = NULL; head_commit = NULL;

View File

@ -98,7 +98,7 @@ int cmd_mktag(int argc,
fsck_set_msg_type_from_ids(&fsck_options, FSCK_MSG_EXTRA_HEADER_ENTRY, fsck_set_msg_type_from_ids(&fsck_options, FSCK_MSG_EXTRA_HEADER_ENTRY,
FSCK_WARN); FSCK_WARN);
/* config might set fsck.extraHeaderEntry=* again */ /* 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, if (fsck_tag_standalone(NULL, buf.buf, buf.len, &fsck_options,
&tagged_oid, &tagged_type)) &tagged_oid, &tagged_type))
die(_("tag on stdin did not pass our strict fsck check")); die(_("tag on stdin did not pass our strict fsck check"));

View File

@ -143,7 +143,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,


opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE; 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); options = add_common_options(builtin_multi_pack_index_write_options);


@ -290,7 +290,7 @@ int cmd_multi_pack_index(int argc,


disable_replace_refs(); disable_replace_refs();


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


if (the_repository && if (the_repository &&
the_repository->objects && the_repository->objects &&

View File

@ -239,7 +239,7 @@ int cmd_mv(int argc,
struct strbuf pathbuf = STRBUF_INIT; struct strbuf pathbuf = STRBUF_INIT;
int ret; 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, argc = parse_options(argc, argv, prefix, builtin_mv_options,
builtin_mv_usage, 0); builtin_mv_usage, 0);

View File

@ -600,7 +600,7 @@ int cmd_name_rev(int argc,


mem_pool_init(&string_pool, 0); mem_pool_init(&string_pool, 0);
init_commit_rev_name(&rev_names); 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); argc = parse_options(argc, argv, prefix, opts, name_rev_usage, 0);


#ifndef WITH_BREAKING_CHANGES #ifndef WITH_BREAKING_CHANGES

View File

@ -1145,7 +1145,7 @@ int cmd_notes(int argc,
OPT_END() 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, argc = parse_options(argc, argv, prefix, options, git_notes_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL); PARSE_OPT_SUBCOMMAND_OPTIONAL);
if (!fn) { if (!fn) {

View File

@ -4924,7 +4924,7 @@ int cmd_pack_objects(int argc,


reset_pack_idx_option(&pack_idx_opts); reset_pack_idx_option(&pack_idx_opts);
pack_idx_opts.flags |= WRITE_REV; 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)) if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
pack_idx_opts.flags &= ~WRITE_REV; pack_idx_opts.flags &= ~WRITE_REV;



View File

@ -235,7 +235,7 @@ int cmd_patch_id(int argc,
OPT_END() OPT_END()
}; };


git_config(git_patch_id_config, &config); repo_config(the_repository, git_patch_id_config, &config);


/* verbatim implies stable */ /* verbatim implies stable */
if (config.verbatim) if (config.verbatim)

View File

@ -999,7 +999,7 @@ int cmd_pull(int argc,
if (!getenv("GIT_REFLOG_ACTION")) if (!getenv("GIT_REFLOG_ACTION"))
set_reflog_message(argc, argv); set_reflog_message(argc, argv);


git_config(git_pull_config, NULL); repo_config(the_repository, git_pull_config, NULL);
if (the_repository->gitdir) { if (the_repository->gitdir) {
prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -598,7 +598,7 @@ int cmd_push(int argc,
}; };


packet_trace_identity("push"); 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); argc = parse_options(argc, argv, prefix, options, push_usage, 0);
push_options = (push_options_cmdline.nr push_options = (push_options_cmdline.nr
? &push_options_cmdline ? &push_options_cmdline

View File

@ -54,7 +54,7 @@ int cmd_range_diff(int argc,
struct object_id oid; struct object_id oid;
const char *three_dots = NULL; 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); repo_diff_setup(the_repository, &diffopt);



View File

@ -168,7 +168,7 @@ int cmd_read_tree(int argc,
opts.src_index = the_repository->index; opts.src_index = the_repository->index;
opts.dst_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, argc = parse_options(argc, argv, cmd_prefix, read_tree_options,
read_tree_usage, 0); read_tree_usage, 0);

View File

@ -1245,7 +1245,7 @@ int cmd_rebase(int argc,
prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; 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 */ /* options.gpg_sign_opt will be either "-S" or NULL */
gpg_sign = options.gpg_sign_opt ? "" : NULL; gpg_sign = options.gpg_sign_opt ? "" : NULL;
FREE_AND_NULL(options.gpg_sign_opt); FREE_AND_NULL(options.gpg_sign_opt);

View File

@ -2613,7 +2613,7 @@ int cmd_receive_pack(int argc,
if (!enter_repo(service_dir, 0)) if (!enter_repo(service_dir, 0))
die("'%s' does not appear to be a git repository", service_dir); 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) if (cert_nonce_seed)
push_cert_nonce = prepare_push_cert_nonce(service_dir, time(NULL)); push_cert_nonce = prepare_push_cert_nonce(service_dir, time(NULL));



View File

@ -202,7 +202,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
OPT_END() OPT_END()
}; };


git_config(reflog_expire_config, &opts); repo_config(the_repository, reflog_expire_config, &opts);


save_commit_buffer = 0; save_commit_buffer = 0;
do_all = status = 0; do_all = status = 0;

View File

@ -88,7 +88,7 @@ static int cmd_refs_verify(int argc, const char **argv, const char *prefix,
if (argc) if (argc)
usage(_("'git refs verify' takes no arguments")); 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); prepare_repo_settings(the_repository);


worktrees = get_worktrees_without_reading_head(); worktrees = get_worktrees_without_reading_head();

View File

@ -353,7 +353,7 @@ static void read_branches(void)
{ {
if (branch_list.nr) if (branch_list.nr)
return; return;
git_config(config_read_branches, NULL); repo_config(the_repository, config_read_branches, NULL);
} }


struct ref_states { struct ref_states {
@ -690,7 +690,7 @@ static void handle_push_default(const char* old_name, const char* new_name)
.origin = STRBUF_INIT, .origin = STRBUF_INIT,
.linenr = -1, .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) if (push_default.scope >= CONFIG_SCOPE_COMMAND)
; /* pass */ ; /* pass */
else if (push_default.scope >= CONFIG_SCOPE_LOCAL) { 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]); strvec_push(&cmd.args, argv[i]);


if (strcmp(cmd.args.v[cmd.args.nr-1], "default") == 0) { 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) { if (!default_defined) {
strvec_pop(&cmd.args); strvec_pop(&cmd.args);
strvec_push(&cmd.args, "--all"); strvec_push(&cmd.args, "--all");

View File

@ -1230,7 +1230,7 @@ int cmd_repack(int argc,


list_objects_filter_init(&po_args.filter_options); 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, argc = parse_options(argc, argv, prefix, builtin_repack_options,
git_repack_usage, 0); git_repack_usage, 0);

View File

@ -574,7 +574,7 @@ int cmd_replace(int argc,
}; };


disable_replace_refs(); 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); argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);



View File

@ -66,7 +66,7 @@ int cmd_rerere(int argc,


argc = parse_options(argc, argv, prefix, options, rerere_usage, 0); 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) if (autoupdate == 1)
flags = RERERE_AUTOUPDATE; flags = RERERE_AUTOUPDATE;

View File

@ -377,7 +377,7 @@ int cmd_reset(int argc,
OPT_END() 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, argc = parse_options(argc, argv, prefix, options, git_reset_usage,
PARSE_OPT_KEEP_DASHDASH); PARSE_OPT_KEEP_DASHDASH);

View File

@ -636,7 +636,7 @@ int cmd_rev_list(int argc,


show_usage_if_asked(argc, argv, rev_list_usage); 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); repo_init_revisions(the_repository, &revs, prefix);
revs.abbrev = DEFAULT_ABBREV; revs.abbrev = DEFAULT_ABBREV;
revs.commit_format = CMIT_FMT_UNSPECIFIED; revs.commit_format = CMIT_FMT_UNSPECIFIED;

View 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. */ /* No options; just report on whether we're in a git repo or not. */
if (argc == 1) { if (argc == 1) {
setup_git_directory(); setup_git_directory();
git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);
return 0; return 0;
} }


@ -769,7 +769,7 @@ int cmd_rev_parse(int argc,
/* The rest of the options require a git repository. */ /* The rest of the options require a git repository. */
if (!did_repo_setup) { if (!did_repo_setup) {
prefix = setup_git_directory(); prefix = setup_git_directory();
git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);
did_repo_setup = 1; did_repo_setup = 1;


prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);

View File

@ -271,7 +271,7 @@ int cmd_rm(int argc,
struct pathspec pathspec; struct pathspec pathspec;
char *seen; 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, argc = parse_options(argc, argv, prefix, builtin_rm_options,
builtin_rm_usage, 0); builtin_rm_usage, 0);

View File

@ -421,7 +421,7 @@ int cmd_shortlog(int argc,
if (nongit && !the_hash_algo) if (nongit && !the_hash_algo)
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT); 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); shortlog_init(&log);
repo_init_revisions(the_repository, &rev, prefix); repo_init_revisions(the_repository, &rev, prefix);
parse_options_start(&ctx, argc, argv, prefix, options, parse_options_start(&ctx, argc, argv, prefix, options,

View File

@ -710,7 +710,7 @@ int cmd_show_branch(int ac,


init_commit_name_slab(&name_slab); 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 nothing is specified, try the default first */
if (ac == 1 && default_args.nr) { if (ac == 1 && default_args.nr) {

View File

@ -324,7 +324,7 @@ struct repository *repo UNUSED)
OPT_END() 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, argc = parse_options(argc, argv, prefix, show_ref_options,
show_ref_usage, 0); show_ref_usage, 0);

View File

@ -1082,7 +1082,7 @@ int cmd_sparse_checkout(int argc,
builtin_sparse_checkout_options, builtin_sparse_checkout_options,
builtin_sparse_checkout_usage, 0); builtin_sparse_checkout_usage, 0);


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


prepare_repo_settings(the_repository); prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -979,7 +979,7 @@ static int show_stash(int argc, const char **argv, const char *prefix,
int do_usage = 0; int do_usage = 0;


init_diff_ui_defaults(); 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); repo_init_revisions(the_repository, &rev, prefix);


argc = parse_options(argc, argv, prefix, options, git_stash_show_usage, argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
@ -2358,7 +2358,7 @@ int cmd_stash(int argc,
const char **args_copy; const char **args_copy;
int ret; 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, argc = parse_options(argc, argv, prefix, options, git_stash_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL | PARSE_OPT_SUBCOMMAND_OPTIONAL |

View File

@ -55,7 +55,7 @@ int cmd_stripspace(int argc,


if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) { if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
setup_git_directory_gently(&nongit); 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) if (strbuf_read(&buf, 0, 1024) < 0)

View File

@ -649,7 +649,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
"--ignore-submodules=dirty", "--quiet", "--", "--ignore-submodules=dirty", "--quiet", "--",
path, NULL); 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); repo_init_revisions(the_repository, &rev, NULL);
rev.abbrev = 0; rev.abbrev = 0;
@ -1108,7 +1108,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
if (info->argc) if (info->argc)
strvec_pushv(&diff_args, info->argv); 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); repo_init_revisions(the_repository, &rev, info->prefix);
rev.abbrev = 0; rev.abbrev = 0;
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL); 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); 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, argc = parse_options(argc, argv, prefix, module_update_options,
git_submodule_helper_usage, 0); git_submodule_helper_usage, 0);
@ -3128,7 +3128,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix,
NULL NULL
}; };


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);
track = git_branch_track; track = git_branch_track;
argc = parse_options(argc, argv, prefix, options, usage, 0); argc = parse_options(argc, argv, prefix, options, usage, 0);



View File

@ -59,7 +59,7 @@ int cmd_symbolic_ref(int argc,
OPT_END(), OPT_END(),
}; };


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, argc = parse_options(argc, argv, prefix, options,
git_symbolic_ref_usage, 0); git_symbolic_ref_usage, 0);
if (msg && !*msg) if (msg && !*msg)

View File

@ -546,7 +546,7 @@ int cmd_tag(int argc,
* Try to set sort keys from config. If config does not set any, * Try to set sort keys from config. If config does not set any,
* fall back on default (refname) sorting. * 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) if (!sorting_options.nr)
string_list_append(&sorting_options, "refname"); string_list_append(&sorting_options, "refname");



View File

@ -43,7 +43,7 @@ int cmd_unpack_file(int argc,
if (repo_get_oid(the_repository, argv[1], &oid)) if (repo_get_oid(the_repository, argv[1], &oid))
die("Not a valid object name %s", argv[1]); 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)); puts(create_temp_file(&oid));
return 0; return 0;

View File

@ -621,7 +621,7 @@ int cmd_unpack_objects(int argc,


disable_replace_refs(); disable_replace_refs();


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


quiet = !isatty(2); quiet = !isatty(2);



View File

@ -1103,7 +1103,7 @@ int cmd_update_index(int argc,
show_usage_with_options_if_asked(argc, argv, show_usage_with_options_if_asked(argc, argv,
update_index_usage, options); update_index_usage, options);


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


prepare_repo_settings(r); prepare_repo_settings(r);
the_repository->settings.command_requires_full_index = 0; the_repository->settings.command_requires_full_index = 0;

View File

@ -769,7 +769,7 @@ int cmd_update_ref(int argc,
OPT_END(), 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, argc = parse_options(argc, argv, prefix, options, git_update_ref_usage,
0); 0);
if (msg && !*msg) if (msg && !*msg)

View File

@ -226,11 +226,11 @@ int cmd_var(int argc,
usage(var_usage); usage(var_usage);


if (strcmp(argv[1], "-l") == 0) { if (strcmp(argv[1], "-l") == 0) {
git_config(show_config, NULL); repo_config(the_repository, show_config, NULL);
list_vars(); list_vars();
return 0; return 0;
} }
git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


git_var = get_git_var(argv[1]); git_var = get_git_var(argv[1]);
if (!git_var) if (!git_var)

View File

@ -81,7 +81,7 @@ int cmd_verify_pack(int argc,
OPT_END() 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, argc = parse_options(argc, argv, prefix, verify_pack_options,
verify_pack_usage, 0); verify_pack_usage, 0);
if (argc < 1) if (argc < 1)

View File

@ -1448,7 +1448,7 @@ int cmd_worktree(int ac,
OPT_END() OPT_END()
}; };


git_config(git_worktree_config, NULL); repo_config(the_repository, git_worktree_config, NULL);


if (!prefix) if (!prefix)
prefix = ""; prefix = "";

View File

@ -43,7 +43,7 @@ int cmd_write_tree(int argc,
OPT_END() 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, argc = parse_options(argc, argv, cmd_prefix, write_tree_options,
write_tree_usage, 0); write_tree_usage, 0);



View File

@ -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); int lookup_config(const char **mapping, int nr_mapping, const char *var);


# ifdef USE_THE_REPOSITORY_VARIABLE # 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) static inline void git_config_clear(void)
{ {
repo_config_clear(the_repository); repo_config_clear(the_repository);

View File

@ -1028,7 +1028,7 @@ static int git_proxy_command_options(const char *var, const char *value,
static int git_use_proxy(const char *host) static int git_use_proxy(const char *host)
{ {
git_proxy_command = getenv("GIT_PROXY_COMMAND"); 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); return (git_proxy_command && *git_proxy_command);
} }



View 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 // 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; identifier C1, C2, D;
attribute name UNUSED; attribute name UNUSED;

View File

@ -1326,7 +1326,7 @@ void convert_attrs(struct index_state *istate,
"eol", "text", "working-tree-encoding", "eol", "text", "working-tree-encoding",
NULL); NULL);
user_convert_tail = &user_convert; 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); git_check_attr(istate, path, check);

View 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) static void fetch_pack_setup(void)

2
fsck.h
View File

@ -287,7 +287,7 @@ const char *fsck_describe_object(struct fsck_options *options,


struct key_value_info; 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. * fsck.<msg> fsck.skipList etc.
*/ */
int git_fsck_config(const char *var, const char *value, int git_fsck_config(const char *var, const char *value,

View File

@ -25,7 +25,7 @@ static void gpg_interface_lazy_init(void)
if (done) if (done)
return; return;
done = 1; done = 1;
git_config(git_gpg_config, NULL); repo_config(the_repository, git_gpg_config, NULL);
} }


static char *configured_signing_key; static char *configured_signing_key;

4
help.c
View File

@ -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) void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
{ {
unsigned int colopts = 0; unsigned int colopts = 0;
git_config(get_colopts, &colopts); repo_config(the_repository, get_colopts, &colopts);


if (main_cmds->cnt) { if (main_cmds->cnt) {
const char *exec_path = git_exec_path(); const char *exec_path = git_exec_path();
@ -502,7 +502,7 @@ static void list_all_cmds_help_aliases(int longest)
struct cmdname_help *aliases; struct cmdname_help *aliases;
int i; int i;


git_config(get_alias, &alias_list); repo_config(the_repository, get_alias, &alias_list);
string_list_sort(&alias_list); string_list_sort(&alias_list);


for (i = 0; i < alias_list.nr; i++) { for (i = 0; i < alias_list.nr; i++) {

View File

@ -150,7 +150,7 @@ int cmd_main(int argc, const char **argv)


trace2_cmd_name("http-fetch"); trace2_cmd_name("http-fetch");


git_config(git_default_config, NULL); repo_config(the_repository, git_default_config, NULL);


if (packfile) { if (packfile) {
if (!index_pack_args.nr) if (!index_pack_args.nr)

2
http.c
View File

@ -1315,7 +1315,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
http_is_verbose = 0; http_is_verbose = 0;
normalized_url = url_normalize(url, &config.url); normalized_url = url_normalize(url, &config.url);


git_config(urlmatch_config_entry, &config); repo_config(the_repository, urlmatch_config_entry, &config);
free(normalized_url); free(normalized_url);
string_list_clear(&config.vars, 1); string_list_clear(&config.vars, 1);



View File

@ -1776,7 +1776,7 @@ int cmd_main(int argc, const char **argv)
int ret; int ret;


setup_git_directory_gently(&nongit_ok); 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); argc = parse_options(argc, (const char **)argv, "", imap_send_options, imap_send_usage, 0);



View File

@ -159,7 +159,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
strbuf_init(&data.buf, 0); strbuf_init(&data.buf, 0);
strvec_init(&data.hidden_refs); 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) { while (packet_reader_read(request) == PACKET_READ_NORMAL) {
const char *arg = request->line; const char *arg = request->line;

View File

@ -357,7 +357,7 @@ static void initialize_ll_merge(void)
if (ll_user_merge_tail) if (ll_user_merge_tail)
return; return;
ll_user_merge_tail = &ll_user_merge; 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) static const struct ll_merge_driver *find_ll_merge_driver(const char *merge_attr)

Some files were not shown because too many files have changed in this diff Show More