]> Pileus Git - ~andy/git/commitdiff
Merge branch 'jk/http-auth-redirects'
authorJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2013 19:09:53 +0000 (12:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2013 19:09:53 +0000 (12:09 -0700)
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

1  2 
http-push.c
http.c
remote-curl.c
t/lib-httpd.sh
t/lib-httpd/apache.conf
t/t5551-http-fetch.sh

diff --cc http-push.c
Simple merge
diff --cc http.c
index 0ddb164a6f239789664c77f1dd97a31086fc71e3,3447945ee4f4e0e4b273d979ea1805b4c0f63b4c..bcf54aa35f96e8f0b87b6e2fd23408991a684b66
--- 1/http.c
--- 2/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 struct credential http_auth = CREDENTIAL_INIT;
 +static int curl_save_cookies;
+ struct credential http_auth = CREDENTIAL_INIT;
  static int http_proactive_auth;
  static const char *user_agent;
  
diff --cc remote-curl.c
index b5ebe0180069c1c1f96b769a37c5f3eb9459dfe9,ef1684b9df3ee5cff0d63ab5f7ed51e7f351a686..c9b891adbf134193f07681a631ae368671e04aa6
@@@ -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");
-       argv_array_push(&args, url);
 +      for_each_string_list_item(cas_option, &cas_options)
 +              argv_array_push(&args, cas_option->string);
+       argv_array_push(&args, url.buf);
        for (i = 0; i < nr_spec; i++)
                argv_array_push(&args, specs[i]);
  
diff --cc t/lib-httpd.sh
Simple merge
Simple merge
Simple merge