Skip to content

Commit 277d7e9

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Acked-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c30e567 commit 277d7e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ first and then run 'git rebase --continue' again."
571571
;;
572572
--)
573573
shift
574-
test ! -z "$REBASE_ROOT" -o $# -eq 1 -o $# -eq 2 || usage
574+
test -z "$REBASE_ROOT" -a $# -ge 1 -a $# -le 2 ||
575+
test ! -z "$REBASE_ROOT" -a $# -le 1 || usage
575576
test -d "$DOTEST" &&
576577
die "Interactive rebase already started"
577578

0 commit comments

Comments
 (0)