am --rebasing: get patch body from commit, not from mailbox
[gitweb.git] / git-rebase.sh
index e6167374445dfbb5e0b6bedc9a5f33a01cb5a7df..6df06c400804776e32b4625ff5820115c0cf1497 100755 (executable)
@@ -400,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
 
@@ -450,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
@@ -462,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."