Skip to content

Commit

Permalink
Do not mask the username when reading credentials
Browse files Browse the repository at this point in the history
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 <yaras6@gmail.com>
  • Loading branch information
yaras authored and dscho committed Jul 27, 2016
1 parent 8800392 commit de53e27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit de53e27

Please sign in to comment.