Skip to content

Commit

Permalink
fix: latest_tag get oldest tag (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
fecet authored Sep 20, 2024
1 parent efe4acd commit f2da23d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/recipe/jinja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ impl Git {
fn latest_tag_rev(&self, src: &str) -> Result<Value, minijinja::Error> {
let result = get_command_output("git", &["ls-remote", "--tags", "--sort=-v:refname", src])?
.lines()
.last()
.next()
.and_then(|s| s.split_ascii_whitespace().nth(0))
.ok_or_else(|| {
minijinja::Error::new(
Expand All @@ -574,7 +574,7 @@ impl Git {
fn latest_tag(&self, src: &str) -> Result<Value, minijinja::Error> {
let result = get_command_output("git", &["ls-remote", "--tags", "--sort=-v:refname", src])?
.lines()
.last()
.next()
.and_then(|s| s.split_ascii_whitespace().nth(1))
.and_then(|s| s.strip_prefix("refs/tags/"))
.map(|s| s.trim_end_matches("^{}"))
Expand Down

0 comments on commit f2da23d

Please sign in to comment.