diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-27 17:17:12 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-27 17:19:20 +0000 |
| commit | e7d7f933cd7eac19434f09096a311adeb5e60747 (patch) | |
| tree | 898c28edec9555f8ef66b0b629de9dea5a535541 /src/lib | |
| parent | 7ca0db29952ddbb27d74e30937562210cfbba56a (diff) | |
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.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/list.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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( | |||
| 605 | let mut remote_issues: HashMap<String, RemoteIssues> = HashMap::new(); | 605 | let mut remote_issues: HashMap<String, RemoteIssues> = HashMap::new(); |
| 606 | 606 | ||
| 607 | for (name, value) in &nostr_state.state { | 607 | for (name, value) in &nostr_state.state { |
| 608 | // skip peeled-tag dereference markers — not real refs | ||
| 609 | if name.ends_with("^{}") { | ||
| 610 | continue; | ||
| 611 | } | ||
| 608 | for (url, (remote_state, _is_grasp_server)) in remote_states { | 612 | for (url, (remote_state, _is_grasp_server)) in remote_states { |
| 609 | let remote_name = get_short_git_server_name(url); | 613 | let remote_name = get_short_git_server_name(url); |
| 610 | let issues = remote_issues.entry(remote_name.clone()).or_default(); | 614 | let issues = remote_issues.entry(remote_name.clone()).or_default(); |