]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
refs.h: implement `hidden_refs_to_excludes()`
authorTaylor Blau <me@ttaylorr.com>
Mon, 10 Jul 2023 21:12:39 +0000 (17:12 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Jul 2023 21:48:56 +0000 (14:48 -0700)
commit15af64dcfd176b65cdb938e9b7f27adb8aabffa4
treece98614a9e078badeabefda1a664378301b8bf22
parente6bf24d39a6a85e0a2257f22bffc09b9df749b4a
refs.h: implement `hidden_refs_to_excludes()`

In subsequent commits, we'll teach `receive-pack` and `upload-pack` to
use the new jump list feature in the packed-refs iterator by ignoring
references which are mentioned via its respective hideRefs lists.

However, the packed-ref jump lists cannot handle un-hiding rules (that
begin with '!'), or namespace comparisons (that begin with '^'). Add a
convenience function to the refs.h API to detect when either of these
conditions are met, and returns an appropriate value to pass as excluded
patterns.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs.h