diff options
Diffstat (limited to 'src/lib/repo_state.rs')
| -rw-r--r-- | src/lib/repo_state.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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 { | |||
| 22 | let mut state = HashMap::new(); | 22 | let mut state = HashMap::new(); |
| 23 | for tag in event.tags.iter() { | 23 | for tag in event.tags.iter() { |
| 24 | if let Some(name) = tag.as_slice().first() { | 24 | if let Some(name) = tag.as_slice().first() { |
| 25 | // include ^{} peeled refs for annotated tags: git requires | ||
| 26 | // both "<tag-oid> refs/tags/v1.0.0" and | ||
| 27 | // "<commit-oid> refs/tags/v1.0.0^{}" in the list output so | ||
| 28 | // it can resolve the tag to a commit. without the ^{} line | ||
| 29 | // git fetch --prune deletes the tag as unresolvable. | ||
| 25 | if ["refs/heads/", "refs/tags", "HEAD"] | 30 | if ["refs/heads/", "refs/tags", "HEAD"] |
| 26 | .iter() | 31 | .iter() |
| 27 | .any(|s| name.starts_with(*s)) | 32 | .any(|s| name.starts_with(*s)) |
| 28 | // dont include dereferenced tags | ||
| 29 | && !name.ends_with("^{}") | ||
| 30 | { | 33 | { |
| 31 | if let Some(value) = tag.as_slice().get(1) { | 34 | if let Some(value) = tag.as_slice().get(1) { |
| 32 | if Oid::from_str(value).is_ok() || value.contains("ref: refs/") { | 35 | if Oid::from_str(value).is_ok() || value.contains("ref: refs/") { |