mirror of
https://github.com/git/git.git
synced 2026-01-09 01:34:00 +00:00
credential: stop using the_repository
Stop using `the_repository` in the "credential" subsystem by passing in a repository when filling, approving or rejecting credentials. Adjust callers accordingly by using `the_repository`. While there may be some callers that have a repository available in their context, this trivial conversion allows for easier verification and bubbles up the use of `the_repository` by one level. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
71e5afee8b
commit
6c27d22276
10
imap-send.c
10
imap-send.c
@@ -922,7 +922,7 @@ static void server_fill_credential(struct imap_server_conf *srvc, struct credent
|
||||
cred->username = xstrdup_or_null(srvc->user);
|
||||
cred->password = xstrdup_or_null(srvc->pass);
|
||||
|
||||
credential_fill(cred, 1);
|
||||
credential_fill(the_repository, cred, 1);
|
||||
|
||||
if (!srvc->user)
|
||||
srvc->user = xstrdup(cred->username);
|
||||
@@ -1123,7 +1123,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
|
||||
} /* !preauth */
|
||||
|
||||
if (cred.username)
|
||||
credential_approve(&cred);
|
||||
credential_approve(the_repository, &cred);
|
||||
credential_clear(&cred);
|
||||
|
||||
/* check the target mailbox exists */
|
||||
@@ -1150,7 +1150,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
|
||||
|
||||
bail:
|
||||
if (cred.username)
|
||||
credential_reject(&cred);
|
||||
credential_reject(the_repository, &cred);
|
||||
credential_clear(&cred);
|
||||
|
||||
out:
|
||||
@@ -1492,9 +1492,9 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
|
||||
|
||||
if (cred.username) {
|
||||
if (res == CURLE_OK)
|
||||
credential_approve(&cred);
|
||||
credential_approve(the_repository, &cred);
|
||||
else if (res == CURLE_LOGIN_DENIED)
|
||||
credential_reject(&cred);
|
||||
credential_reject(the_repository, &cred);
|
||||
}
|
||||
|
||||
credential_clear(&cred);
|
||||
|
||||
Reference in New Issue
Block a user