Skip to content

Commit 8ac6a5b

Browse files
yarasdscho
authored andcommitted
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 97f7fed commit 8ac6a5b

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
@@ -135,7 +135,9 @@ static void credential_getpass(struct credential *c)
135135
{
136136
if (!c->username)
137137
c->username = credential_ask_one("Username", c,
138-
PROMPT_ASKPASS|PROMPT_ECHO);
138+
(getenv("GIT_ASKPASS") ?
139+
PROMPT_ASKPASS : 0) |
140+
PROMPT_ECHO);
139141
if (!c->password)
140142
c->password = credential_ask_one("Password", c,
141143
PROMPT_ASKPASS);

0 commit comments

Comments
 (0)