From: Johannes Schindelin Date: Sun, 25 Jan 2009 23:32:13 +0000 (+0100) Subject: rebase -i --root: fix check for number of arguments X-Git-Tag: v1.6.2-rc0~86 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=277d7e91ae6afbe1b7aa7496320d43fd3f59f7ec;p=git.git rebase -i --root: fix check for number of arguments If we are not rebasing with --root, then $# can only be either 1 (base) or 2 (base and the name of the branch to be rebased). If we are rebasing with --root, then it is Ok if $# is 0 (rebase the current branch down to everything) or 1 (rebase the named branch down to everything). Signed-off-by: Johannes Schindelin Acked-by: Thomas Rast Signed-off-by: Junio C Hamano --- diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 21ac20c30..002929eb0 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -571,7 +571,8 @@ first and then run 'git rebase --continue' again." ;; --) shift - test ! -z "$REBASE_ROOT" -o $# -eq 1 -o $# -eq 2 || usage + test -z "$REBASE_ROOT" -a $# -ge 1 -a $# -le 2 || + test ! -z "$REBASE_ROOT" -a $# -le 1 || usage test -d "$DOTEST" && die "Interactive rebase already started"