diff options
author | Jeff King <peff@peff.net> | 2017-06-21 15:26:36 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-21 14:06:09 -0700 |
commit | d5addcf522deb05d259ecbc0946584d977879565 (patch) | |
tree | 659c54abaedfddcf6e1d549a4b5af86c2f8b33b6 /preload-index.c | |
parent | Merge branch 'va/i18n-perl-scripts' (diff) | |
download | tgif-d5addcf522deb05d259ecbc0946584d977879565.tar.xz |
add--interactive: handle EOF in prompt_yesno
The prompt_yesno function loops indefinitely waiting for a
"y" or "n" response. But it doesn't handle EOF, meaning
that we can end up in an infinite loop of reading EOF from
stdin. One way to simulate that is with:
echo e | GIT_EDITOR='echo corrupt >' git add -p
Let's break out of the loop and propagate the undef to the
caller. Without modifying the callers that effectively turns
it into a "no" response. This is reasonable for both of the
current callers, and it leaves room for any future caller to
check for undef explicitly.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'preload-index.c')
0 files changed, 0 insertions, 0 deletions