From: Junio C Hamano Date: Wed, 30 Oct 2013 19:09:53 +0000 (-0700) Subject: Merge branch 'jk/http-auth-redirects' X-Git-Tag: v1.8.5-rc0~16 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/177f0a400955f2345c73a5c8b0459d617429ffd9?hp=--cc Merge branch 'jk/http-auth-redirects' Handle the case where http transport gets redirected during the authorization request better. * jk/http-auth-redirects: http.c: Spell the null pointer as NULL remote-curl: rewrite base url from info/refs redirects remote-curl: store url as a strbuf remote-curl: make refs_url a strbuf http: update base URLs when we see redirects http: provide effective url to callers http: hoist credential request out of handle_curl_result http: refactor options to http_get_* http_request: factor out curlinfo_strbuf http_get_file: style fixes --- 177f0a400955f2345c73a5c8b0459d617429ffd9 diff --cc http.c index 0ddb164a6f,3447945ee4..bcf54aa35f --- a/http.c +++ b/http.c @@@ -46,8 -45,7 +46,8 @@@ static long curl_low_speed_time = -1 static int curl_ftp_no_epsv; static const char *curl_http_proxy; static const char *curl_cookie_file; +static int curl_save_cookies; - static struct credential http_auth = CREDENTIAL_INIT; + struct credential http_auth = CREDENTIAL_INIT; static int http_proactive_auth; static const char *user_agent; diff --cc remote-curl.c index b5ebe01800,ef1684b9df..c9b891adbf --- a/remote-curl.c +++ b/remote-curl.c @@@ -6,12 -6,13 +6,14 @@@ #include "exec_cmd.h" #include "run-command.h" #include "pkt-line.h" +#include "string-list.h" #include "sideband.h" #include "argv-array.h" + #include "credential.h" static struct remote *remote; - static const char *url; /* always ends with a trailing slash */ + /* always ends with a trailing slash */ + static struct strbuf url = STRBUF_INIT; struct options { int verbosity; @@@ -826,9 -819,7 +841,9 @@@ static int push_git(struct discovery *h else if (options.verbosity > 1) argv_array_push(&args, "--verbose"); argv_array_push(&args, options.progress ? "--progress" : "--no-progress"); + for_each_string_list_item(cas_option, &cas_options) + argv_array_push(&args, cas_option->string); - argv_array_push(&args, url); + argv_array_push(&args, url.buf); for (i = 0; i < nr_spec; i++) argv_array_push(&args, specs[i]);