]> git.ipfire.org Git - thirdparty/git.git/commit
branch: reject "--no-all" and "--no-remotes" early
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2023 18:27:49 +0000 (11:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2023 19:19:53 +0000 (12:19 -0700)
commite12cb98e1e083c23a03fcfabb3a3c6a5a22ce3c5
treeb64357d7ccd2c6d91dc709a74795898e9e82b086
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
branch: reject "--no-all" and "--no-remotes" early

As the command line parser for "git branch --all" forgets to use
PARSE_OPT_NONEG, it accepted "git branch --no-all", and then passed
a nonsense value to the underlying machinery, leading to a fatal
error "filter_refs: invalid type".  The "--remotes" option had
exactly the same issue.

Catch the unsupported options early in the option parser.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c
t/t3203-branch-output.sh