Skip to content

Commit 98a2602

Browse files
davvidgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c41d3fe commit 98a2602

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

git-mergetool.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,6 @@ fi
426426
merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)"
427427
merge_keep_temporaries="$(git config --bool mergetool.keepTemporaries || echo false)"
428428

429-
last_status=0
430-
rollup_status=0
431429
files=
432430

433431
if test $# -eq 0
@@ -455,19 +453,15 @@ printf "%s\n" "$files"
455453

456454
IFS='
457455
'
456+
rc=0
458457
for i in $files
459458
do
460-
if test $last_status -ne 0
461-
then
462-
prompt_after_failed_merge || exit 1
463-
fi
464459
printf "\n"
465-
merge_file "$i"
466-
last_status=$?
467-
if test $last_status -ne 0
460+
if ! merge_file "$i"
468461
then
469-
rollup_status=1
462+
rc=1
463+
prompt_after_failed_merge || exit 1
470464
fi
471465
done
472466

473-
exit $rollup_status
467+
exit $rc

0 commit comments

Comments
 (0)