diff options
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-x | git-rebase--interactive.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index bdec462609..ec798a16e9 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -96,13 +96,14 @@ die_abort () { } pick_one () { - case "$1" in -n) sha1=$2 ;; *) sha1=$1 ;; esac + no_ff= + case "$1" in -n) sha1=$2; no_ff=t ;; *) sha1=$1 ;; esac output git rev-parse --verify $sha1 || die "Invalid commit name: $sha1" test -d "$REWRITTEN" && pick_one_preserving_merges "$@" && return parent_sha1=$(git rev-parse --verify $sha1^ 2>/dev/null) current_sha1=$(git rev-parse --verify HEAD) - if test $current_sha1 = $parent_sha1; then + if test $no_ff$current_sha1 = $parent_sha1; then output git reset --hard $sha1 test "a$1" = a-n && output git reset --soft $current_sha1 sha1=$(git rev-parse --short $sha1) |