From de53e27b7b2fdddce593fa39355fd45b3fef063a Mon Sep 17 00:00:00 2001 From: yaras Date: Tue, 1 Mar 2016 16:12:23 +0100 Subject: [PATCH] Do not mask the username when reading credentials When user is asked for credentials there is no need to mask username, so PROMPT_ASKPASS flag on calling credential_ask_one for login is unnecessary. credential_ask_one internally uses git_prompt which in case of given flag PROMPT_ASKPASS uses masked input method instead of git_terminal_prompt, which does not mask user input. This fixes #675 Signed-off-by: yaras --- credential.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/credential.c b/credential.c index aa996669fc4002..1ba5ce6d027177 100644 --- a/credential.c +++ b/credential.c @@ -135,7 +135,9 @@ static void credential_getpass(struct credential *c) { if (!c->username) c->username = credential_ask_one("Username", c, - PROMPT_ASKPASS|PROMPT_ECHO); + (getenv("GIT_ASKPASS") ? + PROMPT_ASKPASS : 0) | + PROMPT_ECHO); if (!c->password) c->password = credential_ask_one("Password", c, PROMPT_ASKPASS);