Skip to content

Commit 1db65f3

Browse files
peffgitster
authored andcommitted
am: simplify prompt response handling
We'll never see a NULL returned from git_prompt(); if it can't produce any input for us (e.g., because the terminal got EOF) then it will just die(). So there's no need for us to handle NULL here. And even if there was, it doesn't make sense to continue; on a true terminal hangup we'd just loop infinitely trying to get input that will never come. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeb582a commit 1db65f3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

builtin/am.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,9 +1658,7 @@ static int do_interactive(struct am_state *state)
16581658
*/
16591659
reply = git_prompt(_("Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "), PROMPT_ECHO);
16601660

1661-
if (!reply) {
1662-
continue;
1663-
} else if (*reply == 'y' || *reply == 'Y') {
1661+
if (*reply == 'y' || *reply == 'Y') {
16641662
return 0;
16651663
} else if (*reply == 'a' || *reply == 'A') {
16661664
state->interactive = 0;

0 commit comments

Comments
 (0)