upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nostr/events.rs4
-rw-r--r--src/purgatory/helpers.rs6
2 files changed, 8 insertions, 2 deletions
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 {
260 260
261 // Extract tags (refs/tags/*) 261 // Extract tags (refs/tags/*)
262 // Tag format: ["refs/tags/v1.0", "commit_hash"] 262 // Tag format: ["refs/tags/v1.0", "commit_hash"]
263 // Exclude peeled tag notation ("refs/tags/v1.0^{}") — these are git's internal
264 // dereference markers pointing to the underlying commit, not real refs.
263 let tags = event 265 let tags = event
264 .tags 266 .tags
265 .iter() 267 .iter()
266 .filter_map(|t| { 268 .filter_map(|t| {
267 if let TagKind::Custom(s) = t.kind() { 269 if let TagKind::Custom(s) = t.kind() {
268 if s.as_ref().starts_with("refs/tags/") { 270 if s.as_ref().starts_with("refs/tags/") && !s.as_ref().ends_with("^{}") {
269 let parts = t.clone().to_vec(); 271 let parts = t.clone().to_vec();
270 if parts.len() >= 2 { 272 if parts.len() >= 2 {
271 Some(TagState { 273 Some(TagState {
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<RefPair> {
58 let ref_str = ref_name.as_ref(); 58 let ref_str = ref_name.as_ref();
59 59
60 // Only process refs/heads/* and refs/tags/* 60 // Only process refs/heads/* and refs/tags/*
61 if ref_str.starts_with("refs/heads/") || ref_str.starts_with("refs/tags/") { 61 // Exclude peeled tag notation (e.g. "refs/tags/v1.0.0^{}") — these are
62 // git's internal dereference markers, not real refs that get pushed.
63 if (ref_str.starts_with("refs/heads/") || ref_str.starts_with("refs/tags/"))
64 && !ref_str.ends_with("^{}")
65 {
62 // Get the object SHA (first value in tag) 66 // Get the object SHA (first value in tag)
63 let parts = tag.clone().to_vec(); 67 let parts = tag.clone().to_vec();
64 if parts.len() >= 2 { 68 if parts.len() >= 2 {