]> git.ipfire.org Git - thirdparty/git.git/commit
parse-options.c: use new bug() API for optbug()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 2 Jun 2022 12:25:34 +0000 (14:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Jun 2022 19:51:35 +0000 (12:51 -0700)
commit53ca569419aed9706b052c48656715ab0b5f14fd
tree3458649e7d4b6d0fe35de4b8dda1090e5d8eb5c6
parent0cc05b044fd690f37565262a5b09f60c203c5218
parse-options.c: use new bug() API for optbug()

When we run into bugs in parse-options.c usage it's good to be able to
note all the issues we ran into before dying. This use-case is why we
have the optbug() function introduced in 1e5ce570ca3 (parse-options:
clearer reporting of API misuse, 2010-12-02)

Let's change this code to use the new bug() API introduced in the
preceding commit, which cuts down on the verbosity of
parse_options_check().

There are existing uses of BUG() in adjacent code that should have
been using optbug() that aren't being changed here. That'll be done in
a subsequent commit. This only changes the optbug() callers.

Since this will invoke BUG() the previous exit(128) code will be
changed, but in this case that's what we want, i.e. to have
encountering a BUG() return the specific "BUG" exit code.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c