]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/show-ref: stop using global variable to count matches
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Oct 2023 08:16:33 +0000 (09:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2023 03:09:00 +0000 (12:09 +0900)
commit84650989b7055a9016972b8430c882d7d8582e4f
tree1a055906068dcbb2a1ed87c9cca53ee675b76f50
parent7907fb0c97740ce2cb9ce0db706dc66c77bb70a7
builtin/show-ref: stop using global variable to count matches

When passing patterns to git-show-ref(1) we're checking whether any
reference matches -- if none do, we indicate this condition via an
unsuccessful exit code.

We're using a global variable to count these matches, which is required
because the counter is getting incremented in a callback function. But
now that we have the `struct show_ref_data` in place, we can get rid of
the global variable and put the counter in there instead.

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