git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-mergetool--lib.sh: make check_unchanged return 1 on invalid read
@ 2011-09-19 20:03 Jay Soffian
  2011-09-19 20:37 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Jay Soffian @ 2011-09-19 20:03 UTC (permalink / raw)
  To: git; +Cc: Jay Soffian, David Aguilar, Junio C Hamano

Else when the user hits ctrl-c at the "Was the merge successful?
[y/n]" prompt, mergetool goes into an infinite loop asking
for input.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
---
 git-mergetool--lib.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 8fc65d0400..0eb424484c 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -21,7 +21,11 @@ check_unchanged () {
 		do
 			echo "$MERGED seems unchanged."
 			printf "Was the merge successful? [y/n] "
-			read answer
+			if ! read answer
+			then
+				status=1
+				break
+			fi
 			case "$answer" in
 			y*|Y*) status=0; break ;;
 			n*|N*) status=1; break ;;
-- 
1.7.7.rc2.2.gf185

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-20  1:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19 20:03 [PATCH] git-mergetool--lib.sh: make check_unchanged return 1 on invalid read Jay Soffian
2011-09-19 20:37 ` Junio C Hamano
2011-09-19 23:40   ` [PATCH] git-mergetool: check return value from read Jay Soffian
2011-09-20  0:41     ` Junio C Hamano
2011-09-20  1:20       ` Andrew Ardill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).