From a2ecfc5a63311570f0f90c7ee40117e289639cb8 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 26 Feb 2026 15:38:51 +0000 Subject: fix: ignore peeled tag entries (^{}) in state event ref parsing State events (kind 30618) can include refs/tags/^{} entries which are git's notation for the dereferenced commit behind an annotated tag. These are not real git refs and are never sent as part of a push. extract_refs_from_state and RepositoryState::from_event were treating them as real refs, causing can_satisfy_state to reject valid annotated tag pushes: the would-be state after the push lacked the spurious ^{} entry, so the exact-equality check always failed. --- src/purgatory/helpers.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/purgatory') diff --git a/src/purgatory/helpers.rs b/src/purgatory/helpers.rs index a9f6e66..319711b 100644 --- a/src/purgatory/helpers.rs +++ b/src/purgatory/helpers.rs @@ -58,7 +58,11 @@ pub fn extract_refs_from_state(event: &Event) -> Vec { let ref_str = ref_name.as_ref(); // Only process refs/heads/* and refs/tags/* - if ref_str.starts_with("refs/heads/") || ref_str.starts_with("refs/tags/") { + // Exclude peeled tag notation (e.g. "refs/tags/v1.0.0^{}") — these are + // git's internal dereference markers, not real refs that get pushed. + if (ref_str.starts_with("refs/heads/") || ref_str.starts_with("refs/tags/")) + && !ref_str.ends_with("^{}") + { // Get the object SHA (first value in tag) let parts = tag.clone().to_vec(); if parts.len() >= 2 { -- cgit v1.2.3