http: expand http.cookieFile as a path

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>

Brian Norris committed May 4, 2016 at 11:42 UTC e5a39ad8e67d61f1f7dfb6ef9d9127a8b11da72c
2 files changed +3 -2
Documentation/config.txt
+2 -1
@@ -1598,7 +1598,8 @@ http.proxy::
1598 remote.<name>.proxy
1599
1600 http.cookieFile::
1601 - File containing previously stored cookie lines which should be used
1601 + The pathname of a file containing previously stored cookie lines,
1602 + which should be used
1603 in the Git http session, if they match the server. The file format
1604 of the file to read cookies from should be plain HTTP headers or
1605 the Netscape/Mozilla cookie file format (see linkgit:curl[1]).
http.c
+1 -1
@@ -258,7 +258,7 @@ static int http_options(const char *var, const char *value, void *cb)
258 return git_config_string(&curl_http_proxy, var, value);
259
260 if (!strcmp("http.cookiefile", var))
261 - return git_config_string(&curl_cookie_file, var, value);
261 + return git_config_pathname(&curl_cookie_file, var, value);
262 if (!strcmp("http.savecookies", var)) {
263 curl_save_cookies = git_config_bool(var, value);
264 return 0;