builtins: always pass prefix to parse_options()

Our builtins receive a "prefix" argument as part of their cmd_foo()
function. We should always pass this to parse_options() if we're calling
it, as it may be used for OPT_FILENAME() options.

In the cases here, there's no option that would use it, so we're not
fixing any bug. This is just future-proofing and setting a good example
(plus quelling some -Wunused-parameter warnings).

Note in the case of revert/cherry-pick, that we plumb the prefix through
to run_sequencer(), as those builtins are just thin wrappers around it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2023-03-28 16:54:32 -04:00
committed by Junio C Hamano
parent 9dc607f1c2
commit 836c8ceb7a
2 changed files with 6 additions and 5 deletions

View File

@ -81,7 +81,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
int tagged_type;
struct object_id result;
argc = parse_options(argc, argv, NULL,
argc = parse_options(argc, argv, prefix,
builtin_mktag_options,
builtin_mktag_usage, 0);