summaryrefslogtreecommitdiff
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2014-11-20 17:20:29 -0800
committerJunio C Hamano <gitster@pobox.com>2014-11-21 11:27:53 -0800
commit98a260220c9b464dbefce1a23e4c89ed7b6ccb4d (patch)
treee99aafb811a087dd8a7c17654eb6695bd5bb856b /git-mergetool.sh
parentc41d3fedd8a5dec2c2c991822b70b91c50ca047e (diff)
downloadgit-98a260220c9b464dbefce1a23e4c89ed7b6ccb4d.tar.gz
mergetool: simplify conditionals
Combine the $last_status checks into a single conditional. Replace $last_status and $rollup_status with a single variable. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-xgit-mergetool.sh16
1 files changed, 5 insertions, 11 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index ff050e58ff..d20581c15c 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -426,8 +426,6 @@ fi
merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)"
merge_keep_temporaries="$(git config --bool mergetool.keepTemporaries || echo false)"
-last_status=0
-rollup_status=0
files=
if test $# -eq 0
@@ -455,19 +453,15 @@ printf "%s\n" "$files"
IFS='
'
+rc=0
for i in $files
do
- if test $last_status -ne 0
- then
- prompt_after_failed_merge || exit 1
- fi
printf "\n"
- merge_file "$i"
- last_status=$?
- if test $last_status -ne 0
+ if ! merge_file "$i"
then
- rollup_status=1
+ rc=1
+ prompt_after_failed_merge || exit 1
fi
done
-exit $rollup_status
+exit $rc