credential: add credential.*.username
Credential helpers can help users avoid having to type their username and password over and over. However, some users may not want a helper for their password, or they may be running a helper which caches for a short time. In this case, it is convenient to provide the non-secret username portion of their credential via config. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
118250728e
commit
d5742425eb
@ -65,6 +65,10 @@ static int credential_config_callback(const char *var, const char *value,
|
||||
|
||||
if (!strcmp(key, "helper"))
|
||||
string_list_append(&c->helpers, value);
|
||||
else if (!strcmp(key, "username")) {
|
||||
if (!c->username)
|
||||
c->username = xstrdup(value);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user