mirror of
https://github.com/git/git.git
synced 2026-06-24 08:48:31 +00:00
http: extract http_reauth_prepare() from retry paths
All three HTTP retry paths (http_request_recoverable, post_rpc, probe_rpc) call credential_fill() directly when handling HTTP_REAUTH. Extract this into a helper function so that a subsequent commit can add pre-fill logic (such as attempting empty-auth before prompting) in one place. No functional change. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f65aba1e87
commit
a8faa7a560
7
http.c
7
http.c
@@ -665,6 +665,11 @@ static void init_curl_http_auth(CURL *result)
|
||||
}
|
||||
}
|
||||
|
||||
void http_reauth_prepare(int all_capabilities)
|
||||
{
|
||||
credential_fill(the_repository, &http_auth, all_capabilities);
|
||||
}
|
||||
|
||||
/* *var must be free-able */
|
||||
static void var_override(char **var, char *value)
|
||||
{
|
||||
@@ -2398,7 +2403,7 @@ static int http_request_recoverable(const char *url,
|
||||
sleep(retry_delay);
|
||||
}
|
||||
} else if (ret == HTTP_REAUTH) {
|
||||
credential_fill(the_repository, &http_auth, 1);
|
||||
http_reauth_prepare(1);
|
||||
}
|
||||
|
||||
ret = http_request(url, result, target, options);
|
||||
|
||||
Reference in New Issue
Block a user