Skip to content

Commit

Permalink
rebase: remove useless arguments check
Browse files Browse the repository at this point in the history
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 <boklm@mars-attacks.org>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nicolas Vigier authored and Junio C Hamano committed Feb 3, 2014
1 parent 3b4e395 commit 2f9dc1f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,10 @@ do
action=${1##--}
;;
--onto)
test 2 -le "$#" || usage
onto="$2"
shift
;;
-x)
test 2 -le "$#" || usage
cmd="${cmd}exec $2${LF}"
shift
;;
Expand Down

0 comments on commit 2f9dc1f

Please sign in to comment.