From d5742425ebfd3060fd181195f3be84cd28c1d06f Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 10 Dec 2011 05:31:30 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- credential.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'credential.c') diff --git a/credential.c b/credential.c index 96be1c22d..3c17ea197 100644 --- a/credential.c +++ b/credential.c @@ -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; } -- cgit v1.2.1