Skip to content

Commit

Permalink
Merge branch 'cb/maint-mergetool-no-tty'
Browse files Browse the repository at this point in the history
* cb/maint-mergetool-no-tty:
  mergetool: Remove explicit references to /dev/tty

Conflicts:
	git-mergetool.sh
  • Loading branch information
Junio C Hamano committed Sep 3, 2010
2 parents 9502751 + af31471 commit 1998f4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion git-mergetool--lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down
8 changes: 6 additions & 2 deletions git-mergetool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,21 @@ 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"

files_to_merge |
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
Expand Down

0 comments on commit 1998f4c

Please sign in to comment.