Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-05-20 15:07:15 +0300
committerJunio C Hamano <gitster@pobox.com>2019-05-28 20:26:36 +0300
commit1db65f324ecf246f7f5f8e0158daab0420dd18bc (patch)
tree44b451f512d3e780800411732ecf5acd7b8d88e4 /builtin/am.c
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 58a2aef28bb..56b17387772 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1658,9 +1658,7 @@ static int do_interactive(struct am_state *state)
*/
reply = git_prompt(_("Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "), PROMPT_ECHO);
- if (!reply) {
- continue;
- } else if (*reply == 'y' || *reply == 'Y') {
+ if (*reply == 'y' || *reply == 'Y') {
return 0;
} else if (*reply == 'a' || *reply == 'A') {
state->interactive = 0;