git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Abort mergetool on read error from stdinput
@ 2010-12-02  6:28 Robin Rosenberg
  2010-12-02  6:38 ` Jonathan Nieder
  0 siblings, 1 reply; 5+ messages in thread
From: Robin Rosenberg @ 2010-12-02  6:28 UTC (permalink / raw)
  To: junkio; +Cc: git, Robin Rosenberg

If you press e.g Ctrl-C the interactive merge goes into an
infinite loop that is somewhat tricky to stop. Abort the script
if bash read fails.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 git-mergetool--lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 77d4aee..2fc2886 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -35,7 +35,7 @@ check_unchanged () {
 		while true; do
 			echo "$MERGED seems unchanged."
 			printf "Was the merge successful? [y/n] "
-			read answer
+			read answer < /dev/tty || exit 1
 			case "$answer" in
 			y*|Y*) status=0; break ;;
 			n*|N*) status=1; break ;;
-- 
1.7.2.3

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

end of thread, other threads:[~2010-12-03 19:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02  6:28 [PATCH] Abort mergetool on read error from stdinput Robin Rosenberg
2010-12-02  6:38 ` Jonathan Nieder
2010-12-03  9:05   ` Robin Rosenberg
2010-12-03  9:14     ` Jonathan Nieder
2010-12-03 19:45     ` Junio C Hamano

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).