diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-04-22 13:42:58 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-04-22 13:42:58 -0700 |
| commit | 33feaca6bfec2b80bcb915cfb477dcb3b14c7ef0 (patch) | |
| tree | c909ff4dc330308aec6e84fc77f51c8412ab1469 /add-patch.c | |
| parent | 9af3a7cb4d6d2aa7807b1f0d0e5b5b8605177413 (diff) | |
| parent | 1f09aed8346f11c9fd236940b6e500388c394af2 (diff) | |
| download | git-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 'add-patch.c')
| -rw-r--r-- | add-patch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/add-patch.c b/add-patch.c index d8dafa8168..d8bfe379be 100644 --- a/add-patch.c +++ b/add-patch.c @@ -7,6 +7,7 @@ #include "color.h" #include "diff.h" #include "compat/terminal.h" +#include "prompt.h" enum prompt_mode_type { PROMPT_MODE_CHANGE = 0, PROMPT_DELETION, PROMPT_HUNK, @@ -1158,9 +1159,8 @@ static int read_single_character(struct add_p_state *s) return res; } - if (strbuf_getline(&s->answer, stdin) == EOF) + if (git_read_line_interactively(&s->answer) == EOF) return EOF; - strbuf_trim_trailing_newline(&s->answer); return 0; } |
