]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/show-ref: refactor `--exclude-existing` options
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Oct 2023 08:16:29 +0000 (09:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2023 03:09:00 +0000 (12:09 +0900)
commit7907fb0c97740ce2cb9ce0db706dc66c77bb70a7
tree4abdb0e7825d21ba20907b0125887e35aeee9f0c
parent53921d5f8e63eb98cb306ea0b58f76a07bbaf36b
builtin/show-ref: refactor `--exclude-existing` options

It's not immediately obvious options which options are applicable to
what subcommand in git-show-ref(1) because all options exist as global
state. This can easily cause confusion for the reader.

Refactor options for the `--exclude-existing` subcommand to be contained
in a separate structure. This structure is stored on the stack and
passed down as required. Consequently, it clearly delimits the scope of
those options and requires the reader to worry less about global state.

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