diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-06-02 13:26:16 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-06-02 13:26:16 +0100 |
| commit | e45b6284c54ed0e4ff7a9428c92087aa3f8e3cfc (patch) | |
| tree | 6e636cb7e38a0d044c444fd8121e192d4df8fd32 | |
| parent | 4625958aa51d3bfc67f89e39fa28b843a1f0ac8e (diff) | |
fix: ignore dereferenced tags in state
as they are just noise
| -rw-r--r-- | src/bin/git_remote_nostr/list.rs | 3 | ||||
| -rw-r--r-- | src/lib/repo_state.rs | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs index ea29531..c27e4d2 100644 --- a/src/bin/git_remote_nostr/list.rs +++ b/src/bin/git_remote_nostr/list.rs | |||
| @@ -299,7 +299,8 @@ fn list_from_remote_url( | |||
| 299 | head.name().to_string(), | 299 | head.name().to_string(), |
| 300 | format!("ref: {symbolic_reference}"), | 300 | format!("ref: {symbolic_reference}"), |
| 301 | ); | 301 | ); |
| 302 | } else { | 302 | // ignore dereferenced tags |
| 303 | } else if !head.name().to_string().ends_with("^{}") { | ||
| 303 | state.insert(head.name().to_string(), head.oid().to_string()); | 304 | state.insert(head.name().to_string(), head.oid().to_string()); |
| 304 | } | 305 | } |
| 305 | } | 306 | } |
diff --git a/src/lib/repo_state.rs b/src/lib/repo_state.rs index ebd8e7f..f061158 100644 --- a/src/lib/repo_state.rs +++ b/src/lib/repo_state.rs | |||
| @@ -19,6 +19,8 @@ impl RepoState { | |||
| 19 | if ["refs/heads/", "refs/tags", "HEAD"] | 19 | if ["refs/heads/", "refs/tags", "HEAD"] |
| 20 | .iter() | 20 | .iter() |
| 21 | .any(|s| name.starts_with(*s)) | 21 | .any(|s| name.starts_with(*s)) |
| 22 | // dont include dereferenced tags | ||
| 23 | && !name.ends_with("^{}") | ||
| 22 | { | 24 | { |
| 23 | if let Some(value) = tag.as_slice().get(1) { | 25 | if let Some(value) = tag.as_slice().get(1) { |
| 24 | if Oid::from_str(value).is_ok() || value.contains("ref: refs/") { | 26 | if Oid::from_str(value).is_ok() || value.contains("ref: refs/") { |