Skip to content

Commit

Permalink
rebase -i --root: fix check for number of arguments
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jan 26, 2009
1 parent c30e567 commit 277d7e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 277d7e9

Please sign in to comment.