X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=prompt.c;h=5ded21a017f1089c5a5f63c998c3b11631c0a5d6;hb=HEAD;hp=8181eebbfcd0080540bc580416336436ced98297;hpb=05f24ec36f06d580f7fb566261f4a52cde129e76;p=platform%2Fupstream%2Fgit.git diff --git a/prompt.c b/prompt.c index 8181eeb..5ded21a 100644 --- a/prompt.c +++ b/prompt.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "config.h" #include "run-command.h" #include "strbuf.h" #include "prompt.h" @@ -74,7 +75,14 @@ char *git_prompt(const char *prompt, int flags) return r; } -char *git_getpass(const char *prompt) +int git_read_line_interactively(struct strbuf *line) { - return git_prompt(prompt, PROMPT_ASKPASS); + int ret; + + fflush(stdout); + ret = strbuf_getline_lf(line, stdin); + if (ret != EOF) + strbuf_trim_trailing_newline(line); + + return ret; }