From 8d2aa8dfac4048c964453a8983f1dc12ecdfe1c3 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 30 Sep 2020 08:29:02 -0400 Subject: assert PARSE_OPT_NONEG in parse-options callbacks In the spirit of 517fe807d6 (assert NOARG/NONEG behavior of parse-options callbacks, 2018-11-05), let's cover some parse-options callbacks which expect to be used with PARSE_OPT_NONEG but don't explicitly assert that this is the case. These callbacks are all used correctly in the current code, but this will help document their expectations and future-proof the code. As a bonus, it also silences -Wunused-parameters (these were added since the initial sweep of 517fe807d6, and we can't yet turn on -Wunused-parameters to remind people because it has too many existing false positives). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/commit-graph.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin/commit-graph.c') diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 988445abdf..78fa08f43a 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -128,6 +128,8 @@ static int write_option_parse_split(const struct option *opt, const char *arg, { enum commit_graph_split_flags *flags = opt->value; + BUG_ON_OPT_NEG(unset); + opts.split = 1; if (!arg) return 0; -- cgit v1.2.3