Skip to content

Commit

Permalink
mergetool: simplify conditionals
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Aguilar authored and Junio C Hamano committed Nov 21, 2014
1 parent c41d3fe commit 98a2602
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions git-mergetool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 98a2602

Please sign in to comment.