config: drop `git_config_clear()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by default, 2024-08-13) we have moved around a bunch of functions in the config subsystem that depend on `the_repository`. Those function have been converted into mere wrappers around their equivalent function that takes in a repository as parameter, and the intent was that we'll eventually remove those wrappers to make the dependency on the global repository variable explicit at the callsite. Follow through with that intent and remove `git_config_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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jul 23, 2025 at 16:08 UTC 83bd9e03eddffbec034b8c79f46bfd360f0ea267
3 files changed +3 -8
config.h
-5
@@ -719,11 +719,6 @@ NORETURN void git_die_config_linenr(const char *key, const char *filename, int l
719 int lookup_config(const char **mapping, int nr_mapping, const char *var);
720
721 # ifdef USE_THE_REPOSITORY_VARIABLE
722 -static inline void git_config_clear(void)
723 -{
724 - repo_config_clear(the_repository);
725 -}
726 -
722 static inline int git_config_get(const char *key)
723 {
724 return repo_config_get(the_repository, key);
scalar.c
+1 -1
@@ -763,7 +763,7 @@ static int cmd_reconfigure(int argc, const char **argv)
763 break;
764 }
765
766 - git_config_clear();
766 + repo_config_clear(the_repository);
767
768 if (repo_init(&r, gitdir.buf, commondir.buf))
769 goto loop_end;
setup.c
+2 -2
@@ -1741,7 +1741,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
1741 * configuration (including the per-repo config file that we
1742 * ignored previously).
1743 */
1744 - git_config_clear();
1744 + repo_config_clear(the_repository);
1745
1746 /*
1747 * Let's assume that we are in a git repository.
@@ -2337,7 +2337,7 @@ static int create_default_files(const char *template_path,
2337 * disk).
2338 */
2339 copy_templates(template_path);
2340 - git_config_clear();
2340 + repo_config_clear(the_repository);
2341 repo_settings_reset_shared_repository(the_repository);
2342 repo_config(the_repository, git_default_config, NULL);
2343