Thread (64 messages) 64 messages, 4 authors, 2024-08-15

[PATCH v2 09/20] config: expose `repo_config_clear()`

STALE778d

From: Patrick Steinhardt <hidden>
Date: 2024-08-13 09:13:50
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current
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 <redacted>
---
 config.c | 2 +-
 config.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/config.c b/config.c
index ac89b708e7..476cd73c9e 100644
--- 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;
diff --git a/config.h b/config.h
index b13e1bfb8d..8eb3efa0c4 100644
--- 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
-- 
2.46.0.46.g406f326d27.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help