packaging: Add contrib installation
[platform/upstream/git.git] / prompt.c
index 8181eeb..5ded21a 100644 (file)
--- 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;
 }