home_config_paths(): let the caller ignore xdg path
The caller can signal that it is not interested in learning the location of $HOME/.gitconfig by passing global=NULL, but there is no way to decline the path to the configuration file based on $XDG_CONFIG_HOME. Allow the caller to pass xdg=NULL to signal that it is not interested in the XDG location. Commit-message-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9830534e40
commit
06b2d87244
10
path.c
10
path.c
@ -148,10 +148,12 @@ void home_config_paths(char **global, char **xdg, char *file)
|
|||||||
*global = mkpathdup("%s/.gitconfig", home);
|
*global = mkpathdup("%s/.gitconfig", home);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xdg_home)
|
if (xdg) {
|
||||||
*xdg = NULL;
|
if (!xdg_home)
|
||||||
else
|
*xdg = NULL;
|
||||||
*xdg = mkpathdup("%s/git/%s", xdg_home, file);
|
else
|
||||||
|
*xdg = mkpathdup("%s/git/%s", xdg_home, file);
|
||||||
|
}
|
||||||
|
|
||||||
free(to_free);
|
free(to_free);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user