push: unset PARSE_OPT_OPTARG for --recurse-submodules
commitce9baf234f04d2f1d183edbdc14e4ee9da46d895
authorDenton Liu <liu.denton@gmail.com>
Mon, 27 Apr 2020 06:44:08 +0000 (27 02:44 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Apr 2020 17:47:42 +0000 (28 10:47 -0700)
treeed079a7af9cddb5a14164abd88e4765e473c0be7
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec
push: unset PARSE_OPT_OPTARG for --recurse-submodules

When the usage for `git push` is shown, it includes the following
lines

--recurse-submodules[=(check|on-demand|no)]
      control recursive pushing of submodules

which seem to indicate that the argument for --recurse-submodules is
optional. However, we cannot actually run that optiion without an
argument:

$ git push --recurse-submodules
fatal: recurse-submodules missing parameter

Unset PARSE_OPT_OPTARG so that it is clear that this option requires an
argument. Since the parse-options machinery guarantees that an argument
is present now, assume that `arg` is set in the else of
option_parse_recurse_submodules().

Reported-by: Andrew White <andrew.white@audinate.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/push.c