Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with last tag not being detected properly #1570

Merged
merged 1 commit into from
Sep 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion project/GitUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import _root_.org.eclipse.jgit.api.{Git, TransportCommand, PushCommand, CloneCom
import _root_.org.eclipse.jgit.lib.ObjectId
import _root_.org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider

import scala.collection.JavaConverters._

/** Utility functions that help manipulate git repos */
object GitUtils {

Expand Down Expand Up @@ -42,7 +44,8 @@ object GitUtils {
}

/** The latest tag in this repository. */
def latestTagIn(git: Git): Option[String] = Option(git.describe().call())
def latestTagIn(git: Git): Option[String] =
git.tagList.call().asScala.lastOption.map(_.getName().stripPrefix("refs/tags/"))

/** Function that takes a TransportCommand and applies some authentication method on it. */
type GitAuth = TransportCommand[_, _] => Unit
Expand Down