summaryrefslogtreecommitdiff
path: root/git-difftool--helper.sh
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2014-10-26 09:09:20 +0100
committerJunio C Hamano <gitster@pobox.com>2014-10-27 11:17:56 -0700
commit25098690a0151ba29ec1c728d783366c1899624d (patch)
treefaea285763dccc0e2aea44ecfc8ab9f1df3f8ad3 /git-difftool--helper.sh
parent3c2dc76f015b4d52ef02a08c59a4546d00b475e1 (diff)
downloadgit-25098690a0151ba29ec1c728d783366c1899624d.tar.gz
difftool--helper: exit when reading a prompt answer fails
An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does not quit it, but is treated as if 'yes' was answered to the prompt and all following prompts, which is contrary to the user's intent. Fix the error check. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-difftool--helper.sh')
-rwxr-xr-xgit-difftool--helper.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 7ef36b9482..aca0413c28 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -49,7 +49,8 @@ launch_merge_tool () {
else
printf "Launch '%s' [Y/n]: " "$merge_tool"
fi
- if read ans && test "$ans" = n
+ read ans || return
+ if test "$ans" = n
then
return
fi