]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/show-ref: stop using global vars for `show_one()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Oct 2023 08:16:38 +0000 (09:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2023 03:09:00 +0000 (12:09 +0900)
commitb0f0be939841376fa0b8dab963ff439dae5226c3
tree2ab3d6221e33cc066a916f6399c7fe658d07a78b
parent84650989b7055a9016972b8430c882d7d8582e4f
builtin/show-ref: stop using global vars for `show_one()`

The `show_one()` function implicitly receives a bunch of options which
are tracked via global variables. This makes it hard to see which
subcommands of git-show-ref(1) actually make use of these options.

Introduce a `show_one_options` structure that gets passed down to this
function. This allows us to get rid of more global state and makes it
more explicit which subcommands use those options.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/show-ref.c