MCPcopy Index your code
hub / github.com/git/git / credential_fill

Function credential_fill

credential.c:504–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void credential_fill(struct repository *r,
505 struct credential *c, int all_capabilities)
506{
507 int i;
508
509 if ((c->username && c->password) || c->credential)
510 return;
511
512 credential_next_state(c);
513 c->multistage = 0;
514
515 credential_apply_config(r, c);
516 if (all_capabilities)
517 credential_set_all_capabilities(c, CREDENTIAL_OP_INITIAL);
518
519 for (i = 0; i < c->helpers.nr; i++) {
520 credential_do(c, c->helpers.items[i].string, "get");
521
522 if (c->password_expiry_utc < time(NULL)) {
523 /*
524 * Don't use credential_clear() here: callers such as
525 * cmd_credential() expect to still be able to call
526 * credential_write() on a struct credential whose
527 * secrets have expired.
528 */
529 credential_clear_secrets(c);
530 /* Reset expiry to maintain consistency */
531 c->password_expiry_utc = TIME_MAX;
532 }
533 if ((c->username && c->password) || c->credential) {
534 strvec_clear(&c->wwwauth_headers);
535 return;
536 }
537 if (c->quit)
538 die("credential helper '%s' told us to quit",
539 c->helpers.items[i].string);
540 }
541
542 if (credential_getpass(r, c) ||
543 (!c->username && !c->password && !c->credential))
544 die("unable to get password from user");
545}
546
547void credential_approve(struct repository *r, struct credential *c)
548{

Callers 8

init_curl_http_authFunction · 0.85
http_reauth_prepareFunction · 0.85
init_curl_proxy_authFunction · 0.85
has_cert_passwordFunction · 0.85
has_proxy_cert_passwordFunction · 0.85
http_request_recoverableFunction · 0.85
server_fill_credentialFunction · 0.85
cmd_credentialFunction · 0.85

Calls 8

credential_next_stateFunction · 0.85
credential_apply_configFunction · 0.85
credential_doFunction · 0.85
credential_clear_secretsFunction · 0.85
strvec_clearFunction · 0.85
credential_getpassFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected