X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-rebase.sh;h=7a02f2975d443cfe35c98d3c62b656850d7d406c;hb=8960b5a7dfb160be65dc9122df8c7603a5f8aced;hp=c5906611794adadfbd37463481412abae6f11a8f;hpb=e2b1accc59ab5d682d71fd801ebe959c3e871488;p=git.git diff --git a/git-rebase.sh b/git-rebase.sh index c59066117..7a02f2975 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -305,10 +305,12 @@ branch=$(git rev-parse --verify "${branch_name}^0") || exit # Now we are rebasing commits $upstream..$branch on top of $onto -# Check if we are already based on $onto, but this should be -# done only when upstream and onto are the same. +# Check if we are already based on $onto with linear history, +# but this should be done only when upstream and onto are the same. mb=$(git merge-base "$onto" "$branch") -if test "$upstream" = "$onto" && test "$mb" = "$onto" +if test "$upstream" = "$onto" && test "$mb" = "$onto" && + # linear history? + ! git rev-list --parents "$onto".."$branch" | grep " .* " > /dev/null then echo >&2 "Current branch $branch_name is up to date." exit 0