prompt: use git_terminal_prompt
Our custom implementation of git_terminal_prompt has many advantages over regular getpass(), as described in the prior commit. This also lets us implement a PROMPT_ECHO flag for callers who want it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
21aeafceda
commit
a50902590e
3
prompt.c
3
prompt.c
@ -2,6 +2,7 @@
|
||||
#include "run-command.h"
|
||||
#include "strbuf.h"
|
||||
#include "prompt.h"
|
||||
#include "compat/terminal.h"
|
||||
|
||||
static char *do_askpass(const char *cmd, const char *prompt)
|
||||
{
|
||||
@ -50,7 +51,7 @@ char *git_prompt(const char *prompt, int flags)
|
||||
return do_askpass(askpass, prompt);
|
||||
}
|
||||
|
||||
r = getpass(prompt);
|
||||
r = git_terminal_prompt(prompt, flags & PROMPT_ECHO);
|
||||
if (!r)
|
||||
die_errno("could not read '%s'", prompt);
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user