Skip to content

Commit

Permalink
feat(git): distinguish between packages that don't make use of git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed Apr 6, 2024
1 parent 35ec59c commit 929627a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ impl<'a> GitTags<'a> {
.iter()
.find_map(|possible_tag| self.0.iter().find(|&tag| tag.tag == **possible_tag))
}

#[allow(dead_code)]
pub fn len(&self) -> usize {
self.0.len()
}

pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}

impl<'a> GitTag<'a> {
Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ fn main() -> Result<()> {
commit
}
None => {
println!("Found NO tag match with package {}", package.name);
if tags.is_empty() {
println!("Package {} has no tags in git repository", package.name);
} else {
println!("Found NO tag match with package {}", package.name);
}

match &cargo_vcs_info {
Some(cargo_vcs_info) => cargo_vcs_info.git.sha1.clone(),
Expand Down

0 comments on commit 929627a

Please sign in to comment.