Skip to content

Commit

Permalink
Merge pull request #1570 from tgodzik/fix-tag
Browse files Browse the repository at this point in the history
Fix issues with last tag not being detected properly
  • Loading branch information
tgodzik authored Sep 20, 2021
2 parents 1d6b3c7 + f7b6d27 commit 7be9791
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 7be9791

Please sign in to comment.