summaryrefslogtreecommitdiffstats
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-09-25 19:37:11 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-25 19:37:11 +0200
commit52f57e94bd1cc32eef1b02b941250720017f0b34 (patch)
tree4eaa98c07974cea893774a65d5c7ee4fe7217525 /builtin/receive-pack.c
parentMerge branch 'ps/apply-leakfix' (diff)
parentrefs/reftable: wire up support for exclude patterns (diff)
downloadgit-52f57e94bd1cc32eef1b02b941250720017f0b34.tar.xz
git-52f57e94bd1cc32eef1b02b941250720017f0b34.zip
Merge branch 'ps/reftable-exclude'
The reftable backend learned to more efficiently handle exclude patterns while enumerating the refs. * ps/reftable-exclude: refs/reftable: wire up support for exclude patterns reftable/reader: make table iterator reseekable t/unit-tests: introduce reftable library Makefile: stop listing test library objects twice builtin/receive-pack: fix exclude patterns when announcing refs refs: properly apply exclude patterns to namespaced refs
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r--builtin/receive-pack.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c4b766c613..ca9ee7f59f 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -340,12 +340,26 @@ static void show_one_alternate_ref(const struct object_id *oid,
static void write_head_info(void)
{
static struct oidset seen = OIDSET_INIT;
+ struct strvec excludes_vector = STRVEC_INIT;
+ const char **exclude_patterns;
+
+ /*
+ * We need access to the reference names both with and without their
+ * namespace and thus cannot use `refs_for_each_namespaced_ref()`. We
+ * thus have to adapt exclude patterns to carry the namespace prefix
+ * ourselves.
+ */
+ exclude_patterns = get_namespaced_exclude_patterns(
+ hidden_refs_to_excludes(&hidden_refs),
+ get_git_namespace(), &excludes_vector);
refs_for_each_fullref_in(get_main_ref_store(the_repository), "",
- hidden_refs_to_excludes(&hidden_refs),
- show_ref_cb, &seen);
+ exclude_patterns, show_ref_cb, &seen);
for_each_alternate_ref(show_one_alternate_ref, &seen);
+
oidset_clear(&seen);
+ strvec_clear(&excludes_vector);
+
if (!sent_capabilities)
show_ref("capabilities^{}", null_oid());