From a1fe9aff9a678048bade167e3bc9848dd4bcddc6 Mon Sep 17 00:00:00 2001 From: Jan Motin Date: Mon, 15 Dec 2014 13:15:52 +0100 Subject: [PATCH] Git: only push released tag --- src/main/scala/Vcs.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/scala/Vcs.scala b/src/main/scala/Vcs.scala index 26c5db6..19e949f 100644 --- a/src/main/scala/Vcs.scala +++ b/src/main/scala/Vcs.scala @@ -136,7 +136,12 @@ class Git(val baseDir: File) extends Vcs with GitLike { cmd("push", trackingRemote, "%s:%s" format (localBranch, trackingBranch)) } - private def pushTags = cmd("push", "--tags", trackingRemote) + private def pushTags = { + val lastTag = (cmd("for-each-ref", "--count=1", "--sort=-taggerdate", "--format", "%(tag)", "refs/tags") !!). + linesIterator.next() + cmd("push", trackingRemote, lastTag) + } + } object Subversion extends VcsCompanion { @@ -214,4 +219,4 @@ class Subversion(val baseDir: File) extends Vcs { private[sbtrelease] object Try { def apply[A](f: => A): Option[A] = scala.util.control.Exception.allCatch.opt(f) -} \ No newline at end of file +}