From af3147147f39274bd0d47faca196f84c4e9ec68d Mon Sep 17 00:00:00 2001 From: Charles Bailey Date: Fri, 20 Aug 2010 16:25:09 +0100 Subject: mergetool: Remove explicit references to /dev/tty mergetool used /dev/tty to switch back to receiving input from the user via inside a block with a redirected stdin. This harms testability, so change mergetool to save its original stdin to an alternative fd in this block and restore it for those sub-commands that need the original stdin. Includes additional compatibility fix from Jonathan Nieder. Tested-by: Jonathan Nieder Signed-off-by: Charles Bailey Signed-off-by: Junio C Hamano --- git-mergetool--lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-mergetool--lib.sh') diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 51dd0d67ba..b5e1943b1d 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 < /dev/tty + read answer case "$answer" in y*|Y*) status=0; break ;; n*|N*) status=1; break ;; -- cgit v1.2.1