rebase: stricter check of standalone sub command

The sub commands '--continue', '--skip' or '--abort' may only be used
standalone according to the documentation. Other options following the
sub command are currently not accepted, but options preceeding them
are. For example, 'git rebase --continue -v' is not accepted, while
'git rebase -v --continue' is. Tighten up the check and allow no other
options when one of these sub commands are used.

Only check that it is standalone for non-interactive rebase for
now. Once the command line processing for interactive rebase has been
replaced by the command line processing in git-rebase.sh, this check
will also apply to interactive rebase.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Martin von Zweigbergk
2011-02-06 13:43:36 -05:00
committed by Junio C Hamano
parent 3426232248
commit 95135b06fe
4 changed files with 22 additions and 2 deletions

View File

@ -229,6 +229,7 @@ then
fi
test -n "$type" && in_progress=t
total_argc=$#
while test $# != 0
do
case "$1" in
@ -239,9 +240,8 @@ do
OK_TO_SKIP_PRE_REBASE=
;;
--continue|--skip|--abort)
test $total_argc -eq 1 || usage
action=${1##--}
shift
break
;;
--onto)
test 2 -le "$#" || usage