Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 2/3] home_config_path: allow NULL xdg parameter

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:02

Matthieu Moy [off-list ref] writes:
This allows a caller to request the global config file without requesting
the XDG one.

Signed-off-by: Matthieu Moy <redacted>
---
Will rephrase

    A caller can ask only for XDG location by passing global=NULL.
    Allow it to ask only for the $HOME/.gitconfig by passing
    xdg=NULL.

as you seem to have forgotten ;-)
quoted hunk
 path.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/path.c b/path.c
index 3afcdb4..f68df0c 100644
--- a/path.c
+++ b/path.c
@@ -148,10 +148,12 @@ void home_config_paths(char **global, char **xdg, char *file)
 			*global = mkpathdup("%s/.gitconfig", home);
 	}
 
-	if (!xdg_home)
-		*xdg = NULL;
-	else
-		*xdg = mkpathdup("%s/git/%s", xdg_home, file);
+	if (xdg) {
+		if (!xdg_home)
+			*xdg = NULL;
+		else
+			*xdg = mkpathdup("%s/git/%s", xdg_home, file);
+	}
 
 	free(to_free);
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help