]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: mark repository argument as unused
authorJeff King <peff@peff.net>
Tue, 29 Aug 2023 23:44:23 +0000 (19:44 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Aug 2023 00:56:23 +0000 (17:56 -0700)
commitc9f7b1e8f27fac13656eba21261a4a12df23c751
treec71d7dc844f537c013ee16a6f2e73a7acfabb647
parentcb646ffb0aff30cec6cd47d43df8ba33c320afd9
sequencer: mark repository argument as unused

In sequencer_get_last_command(), we don't ever look at the repository
parameter. This is due to ed5b1ca10b (status: do not report errors in
sequencer/todo, 2019-06-27), which dropped the call to parse_insn_line().

However, it _should_ be used when calling into git_path_* functions,
but the one we use here is declared with the non-REPO variant of
GIT_PATH_FUNC(), and so just uses the_repository internally.

We could change the path helper to use REPO_GIT_PATH_FUNC(), but doing
so piecemeal is not great. There are 41 uses of GIT_PATH_FUNC() in
sequencer.c, and inconsistently switching one makes the code more
confusing. Likewise, this one function is used in half a dozen other
spots, all of which would need to start passing in a repository argument
(with rippling effects up the call stack).

So let's punt on that for now and just silence any -Wunused-parameter
warning.

Note that we could also drop this parameter entirely, as the function is
always called directly, and not as a callback that has to conform to
some external interface. But since we'd eventually want to use the
repository parameter, let's leave it in place to avoid disrupting the
callers twice.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c