summaryrefslogtreecommitdiff
path: root/add-patch.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2025-10-25 07:48:28 +0200
committerJunio C Hamano <gitster@pobox.com>2025-10-26 16:34:39 -0700
commite56f6dcd7b4c90192018e848d0810f091d092913 (patch)
tree3908073a7287088228a9c5b351cf1cb8af31d876 /add-patch.c
parent13768117f5e174a7a0403607532e33a7dc40b969 (diff)
add-patch: quit on EOF
If we reach the end of the input, e.g. because the user pressed ctrl-D on Linux, there is no point in showing any more prompts, as we won't get any reply. Do the same as option 'q' would: Quit. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-patch.c')
-rw-r--r--add-patch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/add-patch.c b/add-patch.c
index a70def1f81..173a53241e 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -1569,8 +1569,10 @@ static int patch_update_file(struct add_p_state *s,
if (*s->s.reset_color_interactive)
fputs(s->s.reset_color_interactive, stdout);
fflush(stdout);
- if (read_single_character(s) == EOF)
+ if (read_single_character(s) == EOF) {
+ quit = 1;
break;
+ }
if (!s->answer.len)
continue;