mirror of
https://github.com/git/git
synced 2024-10-02 14:45:21 +00:00
parse-options: add more BUG_ON() annotations
These callbacks are similar to the ones touched by 517fe807d6
(assert
NOARG/NONEG behavior of parse-options callbacks, 2018-11-05), but were
either missed in that commit (the one in add.c) or were added later (the
one in log.c).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
62c5358a5e
commit
abf2952f83
|
@ -232,6 +232,8 @@ static char *chmod_arg;
|
|||
|
||||
static int ignore_removal_cb(const struct option *opt, const char *arg, int unset)
|
||||
{
|
||||
BUG_ON_OPT_ARG(arg);
|
||||
|
||||
/* if we are told to ignore, we are not adding removals */
|
||||
*(int *)opt->value = !unset ? 0 : 1;
|
||||
return 0;
|
||||
|
|
|
@ -121,6 +121,8 @@ static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP;
|
|||
static int clear_decorations_callback(const struct option *opt UNUSED,
|
||||
const char *arg, int unset)
|
||||
{
|
||||
BUG_ON_OPT_NEG(unset);
|
||||
BUG_ON_OPT_ARG(arg);
|
||||
string_list_clear(&decorate_refs_include, 0);
|
||||
string_list_clear(&decorate_refs_exclude, 0);
|
||||
use_default_decoration_filter = 0;
|
||||
|
|
Loading…
Reference in a new issue