X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=http.c;h=e6c75976e8886321732ef2b0b686b08e04a0c200;hb=b4524d343b085b63c68cf5e0a70007c19a048197;hp=a4bc770e2d6196958ec5b795ca89be24be182a34;hpb=82bc9f515c93cdb66f87092c7e270b8de112919f;p=git.git diff --git a/http.c b/http.c index a4bc770e2..e6c75976e 100644 --- a/http.c +++ b/http.c @@ -279,8 +279,6 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY); #endif - init_curl_http_auth(result); - if (ssl_cert != NULL) curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert); if (has_cert_password()) @@ -749,14 +747,6 @@ static inline int needs_quote(int ch) return 1; } -static inline int hex(int v) -{ - if (v < 10) - return '0' + v; - else - return 'A' + v - 10; -} - static char *quote_ref_url(const char *base, const char *ref) { struct strbuf buf = STRBUF_INIT; @@ -846,7 +836,7 @@ static int http_request(const char *url, void *result, int target, int options) else if (missing_target(&results)) ret = HTTP_MISSING_TARGET; else if (results.http_code == 401) { - if (user_name) { + if (user_name && user_pass) { ret = HTTP_NOAUTH; } else { /* @@ -855,7 +845,8 @@ static int http_request(const char *url, void *result, int target, int options) * but that is non-portable. Using git_getpass() can at least be stubbed * on other platforms with a different implementation if/when necessary. */ - user_name = xstrdup(git_getpass_with_description("Username", description)); + if (!user_name) + user_name = xstrdup(git_getpass_with_description("Username", description)); init_curl_http_auth(slot->curl); ret = HTTP_REAUTH; }