diff options
author | Wink Saville <wink@saville.com> | 2018-03-23 07:39:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-23 20:42:05 +0300 |
commit | 0c4030ca26836ae3a8fb2ac934fd850a0d5f4304 (patch) | |
tree | 443355b378a1b1aa5d6c0be0a9fd6368cc5a1560 | |
parent | 90bbd502d54fe920356fa9278055dc9c9bfe9a56 (diff) |
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>
-rw-r--r-- | git-rebase--interactive.sh | 17 |
1 files changed, 7 insertions, 10 deletions
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 |