mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-16 11:02:37 -05:00
config: normalize the path of the system gitconfig
Git for Windows is compiled with a runtime prefix, and that runtime prefix is typically `C:/Program Files/Git/mingw64`. As we want the system gitconfig to live in the sibling directory `etc`, we define the relative path as `../etc/gitconfig`. However, as reported by Philip Oakley, the output of `git config --show-origin --system -l` looks rather ugly, as it shows the path as `file:C:/Program Files/Git/mingw64/../etc/gitconfig`, i.e. with the `mingw64/../` part. By normalizing the path, we get a prettier path. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
6
config.c
6
config.c
@@ -1662,9 +1662,11 @@ static int git_config_from_blob_ref(config_fn_t fn,
|
||||
|
||||
const char *git_etc_gitconfig(void)
|
||||
{
|
||||
static const char *system_wide;
|
||||
if (!system_wide)
|
||||
static char *system_wide;
|
||||
if (!system_wide) {
|
||||
system_wide = system_path(ETC_GITCONFIG);
|
||||
normalize_path_copy(system_wide, system_wide);
|
||||
}
|
||||
return system_wide;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user