rebase: remove useless arguments check
[gitweb.git] / git-rebase.sh
index 7185dc84387d6e20299fdda86800372445b9318e..d1835ba58a253618ff4903d1b8c13749d285837c 100755 (executable)
@@ -5,6 +5,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC="\
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
@@ -237,12 +238,10 @@ do
                action=${1##--}
                ;;
        --onto)
-               test 2 -le "$#" || usage
                onto="$2"
                shift
                ;;
        -x)
-               test 2 -le "$#" || usage
                cmd="${cmd}exec $2${LF}"
                shift
                ;;
@@ -534,7 +533,8 @@ esac
 
 if test "$fork_point" = t
 then
-       new_upstream=$(git merge-base --fork-point "$upstream_name" "$switch_to")
+       new_upstream=$(git merge-base --fork-point "$upstream_name" \
+                       "${switch_to:-HEAD}")
        if test -n "$new_upstream"
        then
                upstream=$new_upstream