]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/show-ref: convert pattern to a local variable
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Oct 2023 08:16:12 +0000 (09:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2023 03:09:00 +0000 (12:09 +0900)
commitff546ebb59d3a393e43d1ec7c97a08b5972a65ee
tree8abf342a401b74719a2422155bc17789aae68d00
parent2e8e77cbac8ac17f94eee2087187fa1718e38b14
builtin/show-ref: convert pattern to a local variable

The `pattern` variable is a global variable that tracks either the
reference names (not patterns!) for the `--verify` mode or the patterns
for the non-verify mode. This is a bit confusing due to the slightly
different meanings.

Convert the variable to be local. While this does not yet fix the double
meaning of the variable, this change allows us to address it in a
subsequent patch more easily by explicitly splitting up the different
subcommands of git-show-ref(1).

Note that we introduce a `struct show_ref_data` to pass the patterns to
`show_ref()`. While this is overengineered now, we will extend this
structure in a subsequent patch.

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