summaryrefslogtreecommitdiff
path: root/prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'prompt.c')
-rw-r--r--prompt.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/prompt.c b/prompt.c
index 6d5885d009..098dcfb7cf 100644
--- a/prompt.c
+++ b/prompt.c
@@ -74,3 +74,13 @@ char *git_prompt(const char *prompt, int flags)
}
return r;
}
+
+int git_read_line_interactively(struct strbuf *line)
+{
+ int ret = strbuf_getline_lf(line, stdin);
+
+ if (ret != EOF)
+ strbuf_trim_trailing_newline(line);
+
+ return ret;
+}