Skip to content

Commit d651a54

Browse files
mymedia2gitster
authored andcommitted
mergetool: don't suggest to continue after last file
Eliminate an unnecessary prompt to continue after failed merger, by not calling the prompt_after_failed_merge function when only one iteration remains. Uses positional parameters to count files in the list to make it easier to see if we have any more paths to process from within the loop. Signed-off-by: Nicholas Guriev <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53f9a3e commit d651a54

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

git-mergetool.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,14 +491,16 @@ main () {
491491
printf "%s\n" "$files"
492492

493493
rc=0
494-
for i in $files
494+
set -- $files
495+
while test $# -ne 0
495496
do
496497
printf "\n"
497-
if ! merge_file "$i"
498+
if ! merge_file "$1"
498499
then
499500
rc=1
500-
prompt_after_failed_merge || exit 1
501+
test $# -ne 1 && prompt_after_failed_merge || exit 1
501502
fi
503+
shift
502504
done
503505

504506
exit $rc

0 commit comments

Comments
 (0)