die "$RESOLVEMSG"
fi
+ cmt=`cat $dotest/current`
if ! git diff-index --quiet HEAD
then
- if ! git-commit -C "`cat $dotest/current`"
+ if ! git-commit -C "$cmt"
then
echo "Commit failed, please do not call \"git commit\""
echo "directly, but instead do one of the following: "
die "$RESOLVEMSG"
fi
- printf "Committed: %0${prec}d" $msgnum
+ printf "Committed: %0${prec}d " $msgnum
else
- printf "Already applied: %0${prec}d" $msgnum
+ printf "Already applied: %0${prec}d " $msgnum
fi
- echo ' '`git rev-list --pretty=oneline -1 HEAD | \
- sed 's/^[a-f0-9]\+ //'`
+ git rev-list --pretty=oneline -1 "$cmt" | sed -e 's/^[^ ]* //'
prev_head=`git rev-parse HEAD^0`
# save the resulting commit so we can read-tree on it later
return
;;
1)
- test -d "$GIT_DIR/rr-cache" && git rerere
+ git rerere
die "$RESOLVEMSG"
;;
2)
--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`"
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"
-v|--verbose)
verbose=t
;;
+ --whitespace=*)
+ git_am_opt="$git_am_opt $1"
+ ;;
-C*)
- git_am_opt=$1
- shift
+ git_am_opt="$git_am_opt $1"
;;
-*)
usage
# 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