From 1e06eb9b5dc9c663c2a60a2ca63e218b41a765e8 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 19 Apr 2021 14:31:12 +0200 Subject: config: unify code paths to get global config paths There's two callsites which assemble global config paths, once in the config loading code and once in the git-config(1) builtin. We're about to implement a way to override global config paths via an environment variable which would require us to adjust both sites. Unify both code paths into a single `git_global_config()` function which returns both paths for `~/.gitconfig` and the XDG config file. This will make the subsequent patch which introduces the new envvar easier to implement. No functional changes are expected from this patch. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- config.h | 1 + 1 file changed, 1 insertion(+) (limited to 'config.h') diff --git a/config.h b/config.h index 2be8fa1880..9038538ffd 100644 --- a/config.h +++ b/config.h @@ -327,6 +327,7 @@ int config_error_nonbool(const char *); #endif char *git_system_config(void); +void git_global_config(char **user, char **xdg); int git_config_parse_parameter(const char *, config_fn_t fn, void *data); -- cgit v1.2.3