From 06ea368bb160af9684a3484c78fddc5af16476ef Mon Sep 17 00:00:00 2001 From: Brian Norris <computersforpeace@gmail.com> Date: Wed, 4 May 2016 11:42:14 -0700 Subject: [PATCH 1/2] Documentation: config: improve word ordering for http.cookieFile Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- Documentation/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index fec0dea5d03..c0d7bcff8ca 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1602,7 +1602,7 @@ http.cookieFile:: 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]). - NOTE that the file specified with http.cookieFile is only used as + NOTE that the file specified with http.cookieFile is used only as input unless http.saveCookies is set. http.saveCookies:: From e5a39ad8e67d61f1f7dfb6ef9d9127a8b11da72c Mon Sep 17 00:00:00 2001 From: Brian Norris <computersforpeace@gmail.com> Date: Wed, 4 May 2016 11:42:15 -0700 Subject: [PATCH 2/2] 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> --- Documentation/config.txt | 3 ++- http.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index c0d7bcff8ca..3c0c48478e0 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -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 c29ce81ccc0..1b4520c626d 100644 --- 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;