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);