aboutsummaryrefslogtreecommitdiffstats
path: root/shell.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-04-22 13:42:58 -0700
committerJunio C Hamano <gitster@pobox.com>2020-04-22 13:42:58 -0700
commit33feaca6bfec2b80bcb915cfb477dcb3b14c7ef0 (patch)
treec909ff4dc330308aec6e84fc77f51c8412ab1469 /shell.c
parent9af3a7cb4d6d2aa7807b1f0d0e5b5b8605177413 (diff)
parent1f09aed8346f11c9fd236940b6e500388c394af2 (diff)
downloadgit-33feaca6bfec2b80bcb915cfb477dcb3b14c7ef0.tar.gz
Merge branch 'js/flush-prompt-before-interative-input'
The interactive input from various codepaths are consolidated and any prompt possibly issued earlier are fflush()ed before we read. * js/flush-prompt-before-interative-input: interactive: explicitly `fflush` stdout before expecting input interactive: refactor code asking the user for interactive input
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell.c b/shell.c
index 54cca7439d..cef7ffdc9e 100644
--- a/shell.c
+++ b/shell.c
@@ -4,6 +4,7 @@
#include "strbuf.h"
#include "run-command.h"
#include "alias.h"
+#include "prompt.h"
#define COMMAND_DIR "git-shell-commands"
#define HELP_COMMAND COMMAND_DIR "/help"
@@ -76,12 +77,11 @@ static void run_shell(void)
int count;
fprintf(stderr, "git> ");
- if (strbuf_getline_lf(&line, stdin) == EOF) {
+ if (git_read_line_interactively(&line) == EOF) {
fprintf(stderr, "\n");
strbuf_release(&line);
break;
}
- strbuf_trim(&line);
rawargs = strbuf_detach(&line, NULL);
split_args = xstrdup(rawargs);
count = split_cmdline(split_args, &argv);