зеркало из https://github.com/microsoft/git.git
Merge branch 'sn/http-auth-with-netrc-fix'
* sn/http-auth-with-netrc-fix: http: don't always prompt for password
This commit is contained in:
Коммит
78c17b9943
5
http.c
5
http.c
|
@ -279,8 +279,6 @@ static CURL *get_curl_handle(void)
|
||||||
curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_curl_http_auth(result);
|
|
||||||
|
|
||||||
if (ssl_cert != NULL)
|
if (ssl_cert != NULL)
|
||||||
curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
|
curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
|
||||||
if (has_cert_password())
|
if (has_cert_password())
|
||||||
|
@ -846,7 +844,7 @@ static int http_request(const char *url, void *result, int target, int options)
|
||||||
else if (missing_target(&results))
|
else if (missing_target(&results))
|
||||||
ret = HTTP_MISSING_TARGET;
|
ret = HTTP_MISSING_TARGET;
|
||||||
else if (results.http_code == 401) {
|
else if (results.http_code == 401) {
|
||||||
if (user_name) {
|
if (user_name && user_pass) {
|
||||||
ret = HTTP_NOAUTH;
|
ret = HTTP_NOAUTH;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
@ -855,6 +853,7 @@ 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
|
* but that is non-portable. Using git_getpass() can at least be stubbed
|
||||||
* on other platforms with a different implementation if/when necessary.
|
* on other platforms with a different implementation if/when necessary.
|
||||||
*/
|
*/
|
||||||
|
if (!user_name)
|
||||||
user_name = xstrdup(git_getpass_with_description("Username", description));
|
user_name = xstrdup(git_getpass_with_description("Username", description));
|
||||||
init_curl_http_auth(slot->curl);
|
init_curl_http_auth(slot->curl);
|
||||||
ret = HTTP_REAUTH;
|
ret = HTTP_REAUTH;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче