summaryrefslogtreecommitdiff
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-09-03 09:43:44 -0700
committerJunio C Hamano <gitster@pobox.com>2010-09-03 09:43:44 -0700
commit1998f4c0966871d49ebf7f720dc58eb9f80771e9 (patch)
tree50418170d8834e6e9f3479bc01517c234317050f /git-mergetool.sh
parent9502751181df4a1347b3bd0fe2f0f0cde9cfaa91 (diff)
parentaf3147147f39274bd0d47faca196f84c4e9ec68d (diff)
downloadgit-1998f4c0966871d49ebf7f720dc58eb9f80771e9.tar.gz
Merge branch 'cb/maint-mergetool-no-tty'
* cb/maint-mergetool-no-tty: mergetool: Remove explicit references to /dev/tty Conflicts: git-mergetool.sh
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-xgit-mergetool.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index bd7ab02f11..2f8dc441c6 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -289,6 +289,10 @@ if test $# -eq 0 ; then
echo "No files need merging"
exit 0
fi
+
+ # Save original stdin
+ exec 3<&0
+
printf "Merging:\n"
printf "$files\n"
@@ -296,10 +300,10 @@ if test $# -eq 0 ; then
while IFS= read i
do
if test $last_status -ne 0; then
- prompt_after_failed_merge < /dev/tty || exit 1
+ prompt_after_failed_merge <&3 || exit 1
fi
printf "\n"
- merge_file "$i" < /dev/tty > /dev/tty
+ merge_file "$i" <&3
last_status=$?
if test $last_status -ne 0; then
rollup_status=1