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/nostr/events.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nostr') diff --git a/src/nostr/events.rs b/src/nostr/events.rs index a441742..00e4486 100644 --- a/src/nostr/events.rs +++ b/src/nostr/events.rs @@ -260,12 +260,14 @@ impl RepositoryState { // Extract tags (refs/tags/*) // Tag format: ["refs/tags/v1.0", "commit_hash"] + // Exclude peeled tag notation ("refs/tags/v1.0^{}") — these are git's internal + // dereference markers pointing to the underlying commit, not real refs. let tags = event .tags .iter() .filter_map(|t| { if let TagKind::Custom(s) = t.kind() { - if s.as_ref().starts_with("refs/tags/") { + if s.as_ref().starts_with("refs/tags/") && !s.as_ref().ends_with("^{}") { let parts = t.clone().to_vec(); if parts.len() >= 2 { Some(TagState { -- cgit v1.2.3