Skip to content

Commit 83bd9e0

Browse files
pks-tgitster
authored andcommitted
config: drop git_config_clear() 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_clear()`. All callsites are adjusted so that they use `repo_config_clear(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 9ce196e commit 83bd9e0

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

config.h

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

721721
# ifdef USE_THE_REPOSITORY_VARIABLE
722-
static inline void git_config_clear(void)
723-
{
724-
repo_config_clear(the_repository);
725-
}
726-
727722
static inline int git_config_get(const char *key)
728723
{
729724
return repo_config_get(the_repository, key);

scalar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static int cmd_reconfigure(int argc, const char **argv)
763763
break;
764764
}
765765

766-
git_config_clear();
766+
repo_config_clear(the_repository);
767767

768768
if (repo_init(&r, gitdir.buf, commondir.buf))
769769
goto loop_end;

setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
17411741
* configuration (including the per-repo config file that we
17421742
* ignored previously).
17431743
*/
1744-
git_config_clear();
1744+
repo_config_clear(the_repository);
17451745

17461746
/*
17471747
* Let's assume that we are in a git repository.
@@ -2337,7 +2337,7 @@ static int create_default_files(const char *template_path,
23372337
* disk).
23382338
*/
23392339
copy_templates(template_path);
2340-
git_config_clear();
2340+
repo_config_clear(the_repository);
23412341
repo_settings_reset_shared_repository(the_repository);
23422342
repo_config(the_repository, git_default_config, NULL);
23432343

0 commit comments

Comments
 (0)