am --rebasing: get patch body from commit, not from mailbox
[gitweb.git] / git-rebase.sh
index 24a2840033c175ff5399de82a1a777c75c0e85dd..6df06c400804776e32b4625ff5820115c0cf1497 100755 (executable)
@@ -167,6 +167,7 @@ run_specific_rebase () {
        if [ "$interactive_rebase" = implied ]; then
                GIT_EDITOR=:
                export GIT_EDITOR
+               autosquash=
        fi
        . git-rebase--$type
 }
@@ -399,6 +400,7 @@ else
        test -z "$onto" && die "You must specify --onto when using --root"
        unset upstream_name
        unset upstream
+       test $# -gt 1 && usage
        upstream_arg=--root
 fi
 
@@ -423,7 +425,7 @@ case "$onto_name" in
        ;;
 *)
        onto=$(git rev-parse --verify "${onto_name}^0") ||
-       die "Does not point to a valid commit: $1"
+       die "Does not point to a valid commit: $onto_name"
        ;;
 esac
 
@@ -449,7 +451,7 @@ case "$#" in
                die "fatal: no such branch: $1"
        fi
        ;;
-*)
+0)
        # Do not need to switch branches, we are already on it.
        if branch_name=`git symbolic-ref -q HEAD`
        then
@@ -461,6 +463,9 @@ case "$#" in
        fi
        orig_head=$(git rev-parse --verify "${branch_name}^0") || exit
        ;;
+*)
+       die "BUG: unexpected number of arguments left to parse"
+       ;;
 esac
 
 require_clean_work_tree "rebase" "Please commit or stash them."