rebase-interactive: simplify pick_on_preserving_merges

Use compound if statement instead of nested if statements to simplify pick_on_preserving_merges. Signed-off-by: Wink Saville <wink@saville.com> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Wink Saville committed Mar 22, 2018 at 21:39 UTC 0c4030ca26836ae3a8fb2ac934fd850a0d5f4304
1 file changed +7 -10
git-rebase--interactive.sh
+7 -10
@@ -307,17 +307,14 @@ pick_one_preserving_merges () {
307 esac
308 sha1=$(git rev-parse $sha1)
309
310 - if test -f "$state_dir"/current-commit
310 + if test -f "$state_dir"/current-commit && test "$fast_forward" = t
311 then
312 - if test "$fast_forward" = t
313 - then
314 - while read current_commit
315 - do
316 - git rev-parse HEAD > "$rewritten"/$current_commit
317 - done <"$state_dir"/current-commit
318 - rm "$state_dir"/current-commit ||
319 - die "$(gettext "Cannot write current commit's replacement sha1")"
320 - fi
312 + while read current_commit
313 + do
314 + git rev-parse HEAD > "$rewritten"/$current_commit
315 + done <"$state_dir"/current-commit
316 + rm "$state_dir"/current-commit ||
317 + die "$(gettext "Cannot write current commit's replacement sha1")"
318 fi
319
320 echo $sha1 >> "$state_dir"/current-commit