http: expand http.cookieFile as a path
authorBrian Norris <computersforpeace@gmail.com>
Wed, 4 May 2016 18:42:15 +0000 (11:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 May 2016 22:59:26 +0000 (15:59 -0700)
This should handle .gitconfig files that specify things like:

[http]
cookieFile = "~/.gitcookies"

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
http.c
index c0d7bcff8ca13faf0d40a2cda489e18c2a308db2..3c0c48478e0efce977197e0cf19fa9dfef487ea9 100644 (file)
@@ -1598,7 +1598,8 @@ http.proxy::
        remote.<name>.proxy
 
 http.cookieFile::
-       File containing previously stored cookie lines which should be used
+       The pathname of a file containing previously stored cookie lines,
+       which should be used
        in the Git http session, if they match the server. The file format
        of the file to read cookies from should be plain HTTP headers or
        the Netscape/Mozilla cookie file format (see linkgit:curl[1]).
diff --git a/http.c b/http.c
index c29ce81ccc0432a80ac5d228d975f246ca47f4b4..1b4520c626d1ecf6794ac19663da2d31f0f3172e 100644 (file)
--- a/http.c
+++ b/http.c
@@ -258,7 +258,7 @@ static int http_options(const char *var, const char *value, void *cb)
                return git_config_string(&curl_http_proxy, var, value);
 
        if (!strcmp("http.cookiefile", var))
-               return git_config_string(&curl_cookie_file, var, value);
+               return git_config_pathname(&curl_cookie_file, var, value);
        if (!strcmp("http.savecookies", var)) {
                curl_save_cookies = git_config_bool(var, value);
                return 0;