Skip to content

Commit 9ce196e

Browse files
pks-tgitster
authored andcommitted
config: drop git_config() wrapper
In 036876a (config: hide functions using `the_repository` by default, 2024-08-13) we have moved around a bunch of functions in the config subsystem that depend on `the_repository`. Those function have been converted into mere wrappers around their equivalent function that takes in a repository as parameter, and the intent was that we'll eventually remove those wrappers to make the dependency on the global repository variable explicit at the callsite. Follow through with that intent and remove `git_config()`. 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 86c9c14 commit 9ce196e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+148
-153
lines changed

Documentation/user-manual.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4270,7 +4270,7 @@ So, look into `builtin/cat-file.c`, search for `cmd_cat_file()` and look what
42704270
it does.
42714271

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

apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static void git_apply_config(void)
5050
{
5151
git_config_get_string("apply.whitespace", &apply_default_whitespace);
5252
git_config_get_string("apply.ignorewhitespace", &apply_default_ignorewhitespace);
53-
git_config(git_xmerge_config, NULL);
53+
repo_config(the_repository, git_xmerge_config, NULL);
5454
}
5555

5656
static int parse_whitespace_option(struct apply_state *state, const char *option)

archive-tar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void init_tar_archiver(void)
537537
tar_filter_config("tar.tgz.remote", "true", NULL);
538538
tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
539539
tar_filter_config("tar.tar.gz.remote", "true", NULL);
540-
git_config(git_tar_config, NULL);
540+
repo_config(the_repository, git_tar_config, NULL);
541541
for (i = 0; i < nr_tar_filters; i++) {
542542
/* omit any filters that never had a command configured */
543543
if (tar_filters[i]->filter_command)

archive-zip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static int write_zip_archive(const struct archiver *ar UNUSED,
632632
{
633633
int err;
634634

635-
git_config(archive_zip_config, NULL);
635+
repo_config(the_repository, archive_zip_config, NULL);
636636

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

archive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
761761
int rc;
762762

763763
git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable);
764-
git_config(git_default_config, NULL);
764+
repo_config(the_repository, git_default_config, NULL);
765765

766766
describe_status.max_invocations = 1;
767767
ctx.date_mode.type = DATE_NORMAL;

builtin/am.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ int cmd_am(int argc,
24452445

24462446
show_usage_with_options_if_asked(argc, argv, usage, options);
24472447

2448-
git_config(git_default_config, NULL);
2448+
repo_config(the_repository, git_default_config, NULL);
24492449

24502450
am_state_init(&state);
24512451

builtin/blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ int cmd_blame(int argc,
947947
const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
948948

949949
setup_default_color_by_age();
950-
git_config(git_blame_config, &output_option);
950+
repo_config(the_repository, git_blame_config, &output_option);
951951
repo_init_revisions(the_repository, &revs, NULL);
952952
revs.date_mode = blame_date_mode;
953953
revs.diffopt.flags.allow_textconv = 1;

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ int cmd_branch(int argc,
791791
* Try to set sort keys from config. If config does not set any,
792792
* fall back on default (refname) sorting.
793793
*/
794-
git_config(git_branch_config, &sorting_options);
794+
repo_config(the_repository, git_branch_config, &sorting_options);
795795
if (!sorting_options.nr)
796796
string_list_append(&sorting_options, "refname");
797797

builtin/cat-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ int cmd_cat_file(int argc,
10951095
OPT_END()
10961096
};
10971097

1098-
git_config(git_cat_file_config, NULL);
1098+
repo_config(the_repository, git_cat_file_config, NULL);
10991099

11001100
batch.buffer_output = -1;
11011101

builtin/check-attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int cmd_check_attr(int argc,
119119
if (!is_bare_repository())
120120
setup_work_tree();
121121

122-
git_config(git_default_config, NULL);
122+
repo_config(the_repository, git_default_config, NULL);
123123

124124
argc = parse_options(argc, argv, prefix, check_attr_options,
125125
check_attr_usage, PARSE_OPT_KEEP_DASHDASH);

0 commit comments

Comments
 (0)