summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-07-16 17:42:46 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-07-16 17:42:46 -0700
commitbc34e5227b683c5bb0a85211354f5eb3ccd8cc19 (patch)
tree55c3396e3dfff93f2122eddbf1c66703bd59da1e /config.c
parentMerge branch 'ks/submodule-cleanup' (diff)
parentconfig: normalize the path of the system gitconfig (diff)
downloadtgif-bc34e5227b683c5bb0a85211354f5eb3ccd8cc19.tar.xz
Merge branch 'js/gfw-system-config-loc-fix'
Update the location of system-side configuration file on Windows. * js/gfw-system-config-loc-fix: config: normalize the path of the system gitconfig cmake(windows): set correct path to the system Git config mingw: move Git for Windows' system config where users expect it
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/config.c b/config.c
index f9c400ad30..3cd10aeb90 100644
--- a/config.c
+++ b/config.c
@@ -1833,9 +1833,10 @@ static int git_config_from_blob_ref(config_fn_t fn,
char *git_system_config(void)
{
char *system_config = xstrdup_or_null(getenv("GIT_CONFIG_SYSTEM"));
- if (system_config)
- return system_config;
- return system_path(ETC_GITCONFIG);
+ if (!system_config)
+ system_config = system_path(ETC_GITCONFIG);
+ normalize_path_copy(system_config, system_config);
+ return system_config;
}
void git_global_config(char **user_out, char **xdg_out)