Skip to content

Commit 6d9990a

Browse files
committed
mergetool: no longer need to save standard input
Earlier code wanted to run merge_file and prompt_after_failed_merge both of which wanted to read from the standard input of the entire script inside a while loop, which read from a pipe, and in order to do so, it redirected the original standard input to another file descriptor. We no longer need to do so after the previous change. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3e8e691 commit 6d9990a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

git-mergetool.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,20 +362,18 @@ if test -z "$files" ; then
362362
exit 0
363363
fi
364364

365-
# Save original stdin
366-
exec 3<&0
367-
368365
printf "Merging:\n"
369366
printf "$files\n"
370367

371368
IFS='
372-
'; for i in $files
369+
'
370+
for i in $files
373371
do
374372
if test $last_status -ne 0; then
375-
prompt_after_failed_merge <&3 || exit 1
373+
prompt_after_failed_merge || exit 1
376374
fi
377375
printf "\n"
378-
merge_file "$i" <&3
376+
merge_file "$i"
379377
last_status=$?
380378
if test $last_status -ne 0; then
381379
rollup_status=1

0 commit comments

Comments
 (0)