X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-rebase.sh;h=cbafa14ed524212441ba76e1bdb558585795e2f3;hb=b24f56d60491416a1c5a8fc71863bbaa0f390f23;hp=c5906611794adadfbd37463481412abae6f11a8f;hpb=e2b1accc59ab5d682d71fd801ebe959c3e871488;p=git.git diff --git a/git-rebase.sh b/git-rebase.sh index c59066117..cbafa14ed 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -101,7 +101,7 @@ call_merge () { return ;; 1) - test -d "$GIT_DIR/rr-cache" && git rerere + git rerere die "$RESOLVEMSG" ;; 2) @@ -160,10 +160,7 @@ do --skip) if test -d "$dotest" then - if test -d "$GIT_DIR/rr-cache" - then - git rerere clear - fi + git rerere clear prev_head="`cat $dotest/prev_head`" end="`cat $dotest/end`" msgnum="`cat $dotest/msgnum`" @@ -181,10 +178,7 @@ do exit ;; --abort) - if test -d "$GIT_DIR/rr-cache" - then - git rerere clear - fi + git rerere clear if test -d "$dotest" then rm -r "$dotest" @@ -305,10 +299,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