From 28ad5440c7184de9833f8448bc90153ee4499c83 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 27 Feb 2026 15:40:24 +0000 Subject: fix: annotated tags missing from list due to dropped peeled refs RepoState::try_from was explicitly discarding all refs/tags/*^{} entries ("peeled" refs) when parsing the nostr state event. This meant the list command only advertised the tag object OID, but git requires two lines for annotated tags: refs/tags/v1.0.0 refs/tags/v1.0.0^{} Without the ^{} peeled line git cannot resolve the tag to a commit, so git fetch --prune treats it as unresolvable and deletes it. The nostr state event already stores both entries correctly (written by generate_updated_state in push.rs). The fix simply stops try_from from discarding the ^{} entries on read, so they flow through to the list output unchanged. --- src/lib/repo_state.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/repo_state.rs b/src/lib/repo_state.rs index 345f05c..223fe56 100644 --- a/src/lib/repo_state.rs +++ b/src/lib/repo_state.rs @@ -22,11 +22,14 @@ impl RepoState { let mut state = HashMap::new(); for tag in event.tags.iter() { if let Some(name) = tag.as_slice().first() { + // include ^{} peeled refs for annotated tags: git requires + // both " refs/tags/v1.0.0" and + // " refs/tags/v1.0.0^{}" in the list output so + // it can resolve the tag to a commit. without the ^{} line + // git fetch --prune deletes the tag as unresolvable. if ["refs/heads/", "refs/tags", "HEAD"] .iter() .any(|s| name.starts_with(*s)) - // dont include dereferenced tags - && !name.ends_with("^{}") { if let Some(value) = tag.as_slice().get(1) { if Oid::from_str(value).is_ok() || value.contains("ref: refs/") { -- cgit v1.2.3