Skip to content

Commit c7df20f

Browse files
yarasGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
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 <[email protected]>
1 parent 33f201f commit c7df20f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

credential.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ static void credential_getpass(struct credential *c)
136136
{
137137
if (!c->username)
138138
c->username = credential_ask_one("Username", c,
139-
PROMPT_ASKPASS|PROMPT_ECHO);
139+
(getenv("GIT_ASKPASS") ?
140+
PROMPT_ASKPASS : 0) |
141+
PROMPT_ECHO);
140142
if (!c->password)
141143
c->password = credential_ask_one("Password", c,
142144
PROMPT_ASKPASS);

0 commit comments

Comments
 (0)