summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Guriev <guriev-ns@ya.ru>2018-08-13 05:09:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 19:11:19 (GMT)
commitd651a54b8a22a307f5b061ba50c5348ae31e861c (patch)
tree3680a28a6d5296e4d4ef5c110278b818635876fa
parent53f9a3e157dbbc901a02ac2c73346d375e24978c (diff)
downloadgit-d651a54b8a22a307f5b061ba50c5348ae31e861c.zip
git-d651a54b8a22a307f5b061ba50c5348ae31e861c.tar.gz
git-d651a54b8a22a307f5b061ba50c5348ae31e861c.tar.bz2
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>
-rwxr-xr-xgit-mergetool.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index c062e3d..d07c7f3 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -491,14 +491,16 @@ main () {
printf "%s\n" "$files"
rc=0
- for i in $files
+ set -- $files
+ while test $# -ne 0
do
printf "\n"
- if ! merge_file "$i"
+ if ! merge_file "$1"
then
rc=1
- prompt_after_failed_merge || exit 1
+ test $# -ne 1 && prompt_after_failed_merge || exit 1
fi
+ shift
done
exit $rc