]> git.ipfire.org Git - thirdparty/git.git/commit - upload-pack.c
refs: get rid of global list of hidden refs
authorPatrick Steinhardt <ps@pks.im>
Thu, 17 Nov 2022 05:46:43 +0000 (06:46 +0100)
committerTaylor Blau <me@ttaylorr.com>
Thu, 17 Nov 2022 21:22:51 +0000 (16:22 -0500)
commit9b67eb6fbeb9666640f34cccf401cfea22f7bd22
tree0e621cf74bf789927c02e3ec70c95fc1ff8af217
parent5eeb9aa2086edc95f4f2c9cc844f60535f0a5ca4
refs: get rid of global list of hidden refs

We're about to add a new argument to git-rev-list(1) that allows it to
add all references that are visible when taking `transfer.hideRefs` et
al into account. This will require us to potentially parse multiple sets
of hidden refs, which is not easily possible right now as there is only
a single, global instance of the list of parsed hidden refs.

Refactor `parse_hide_refs_config()` and `ref_is_hidden()` so that both
take the list of hidden references as input and adjust callers to keep a
local list, instead. This allows us to easily use multiple hidden-ref
lists. Furthermore, it allows us to properly free this list before we
exit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
builtin/receive-pack.c
ls-refs.c
refs.c
refs.h
upload-pack.c