Skip to content

Commit 2f9dc1f

Browse files
boklmgitster
authored andcommitted
rebase: remove useless arguments check
Remove a check on the number of arguments for --onto and -x options. It is not possible for $# to be <= 2 at this point : - if --onto or -x has an argument, git rev-parse --parseopt will provide something like this : set -- --onto 'x' -- when parsing the "--onto" option, $# will be 3 or more if there are other options. - if --onto or -x doesn't have an argument, git rev-parse --parseopt will exit with an error and display usage information. Signed-off-by: Nicolas Vigier <[email protected]> Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b4e395 commit 2f9dc1f

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

git-rebase.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,10 @@ do
238238
action=${1##--}
239239
;;
240240
--onto)
241-
test 2 -le "$#" || usage
242241
onto="$2"
243242
shift
244243
;;
245244
-x)
246-
test 2 -le "$#" || usage
247245
cmd="${cmd}exec $2${LF}"
248246
shift
249247
;;

0 commit comments

Comments
 (0)