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 <guriev-ns@ya.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
53f9a3e157
commit
d651a54b8a
@ -491,14 +491,16 @@ main () {
|
|||||||
printf "%s\n" "$files"
|
printf "%s\n" "$files"
|
||||||
|
|
||||||
rc=0
|
rc=0
|
||||||
for i in $files
|
set -- $files
|
||||||
|
while test $# -ne 0
|
||||||
do
|
do
|
||||||
printf "\n"
|
printf "\n"
|
||||||
if ! merge_file "$i"
|
if ! merge_file "$1"
|
||||||
then
|
then
|
||||||
rc=1
|
rc=1
|
||||||
prompt_after_failed_merge || exit 1
|
test $# -ne 1 && prompt_after_failed_merge || exit 1
|
||||||
fi
|
fi
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
exit $rc
|
exit $rc
|
||||||
|
Loading…
Reference in New Issue
Block a user