From: Wink Saville Date: Fri, 23 Mar 2018 04:39:52 +0000 (-0700) Subject: rebase-interactive: simplify pick_on_preserving_merges X-Git-Tag: v2.18.0-rc0~156^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0c4030ca26836ae3a8fb2ac934fd850a0d5f4304?ds=inline;hp=--cc 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 Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- 0c4030ca26836ae3a8fb2ac934fd850a0d5f4304 diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 331c8dfeac..561e2660ed 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -307,17 +307,14 @@ pick_one_preserving_merges () { esac sha1=$(git rev-parse $sha1) - if test -f "$state_dir"/current-commit + if test -f "$state_dir"/current-commit && test "$fast_forward" = t then - if test "$fast_forward" = t - then - while read current_commit - do - git rev-parse HEAD > "$rewritten"/$current_commit - done <"$state_dir"/current-commit - rm "$state_dir"/current-commit || - die "$(gettext "Cannot write current commit's replacement sha1")" - fi + while read current_commit + do + git rev-parse HEAD > "$rewritten"/$current_commit + done <"$state_dir"/current-commit + rm "$state_dir"/current-commit || + die "$(gettext "Cannot write current commit's replacement sha1")" fi echo $sha1 >> "$state_dir"/current-commit