]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config: expose `repo_config_clear()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 13 Aug 2024 09:13:46 +0000 (11:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Aug 2024 17:01:02 +0000 (10:01 -0700)
While we already have `repo_config_clear()` as an alternative to
`git_config_clear()` that doesn't rely on `the_repository`, it is not
exposed to callers outside of the config subsystem. Do so.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c
config.h

index ac89b708e7d031a203e9f8036ecb9d2468d04492..476cd73c9e249bc970fde34becedc4f6179cda4e 100644 (file)
--- a/config.c
+++ b/config.c
@@ -2564,7 +2564,7 @@ static void git_config_check_init(struct repository *repo)
        repo_read_config(repo);
 }
 
-static void repo_config_clear(struct repository *repo)
+void repo_config_clear(struct repository *repo)
 {
        if (!repo->config || !repo->config->hash_initialized)
                return;
index b13e1bfb8d7f982a086582b882ca83b55542ca71..8eb3efa0c411ad916659d74dfd3e12ded410020b 100644 (file)
--- a/config.h
+++ b/config.h
@@ -651,6 +651,7 @@ int git_config_get_string_multi(const char *key,
  * Resets and invalidates the config cache.
  */
 void git_config_clear(void);
+void repo_config_clear(struct repository *repo);
 
 /**
  * Allocates and copies the retrieved string into the `dest` parameter for