From e7d7f933cd7eac19434f09096a311adeb5e60747 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 27 Feb 2026 17:17:12 +0000 Subject: fix: skip ^{} peeled-tag refs in sync to prevent invalid refspec crash Regression introduced in 28ad5440: ngit sync crashed with 'invalid refspec refs/remotes/origin/v1.4.4^{}:refs/tags/v1.4.4^{}' on repos with annotated tags. Fixed by guarding all three iteration sites in sync.rs and identify_remote_sync_issues in list.rs; also corrected the always-false logic bug in invalid_nostr_state_ref. --- src/lib/list.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/list.rs') diff --git a/src/lib/list.rs b/src/lib/list.rs index d8b038e..19d17df 100644 --- a/src/lib/list.rs +++ b/src/lib/list.rs @@ -605,6 +605,10 @@ pub fn identify_remote_sync_issues( let mut remote_issues: HashMap = HashMap::new(); for (name, value) in &nostr_state.state { + // skip peeled-tag dereference markers — not real refs + if name.ends_with("^{}") { + continue; + } for (url, (remote_state, _is_grasp_server)) in remote_states { let remote_name = get_short_git_server_name(url); let issues = remote_issues.entry(remote_name.clone()).or_default(); -- cgit v1.2.3