Skip to content

Commit

Permalink
Merge pull request #130 from chali/ListOnlyTagNames
Browse files Browse the repository at this point in the history
Use jgit git to list all tags to reduce memory footprint.
  • Loading branch information
chali committed Dec 19, 2018
2 parents 4e4e45a + 20b96c1 commit c952f6d
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -18,6 +18,7 @@ package nebula.plugin.release.git.semver
import com.github.zafarkhaja.semver.Version
import nebula.plugin.release.git.base.TagStrategy
import org.ajoberstar.grgit.Grgit
import org.ajoberstar.grgit.Tag
import org.eclipse.jgit.lib.ObjectId
import org.eclipse.jgit.revwalk.RevCommit
import org.eclipse.jgit.revwalk.RevWalk
Expand Down Expand Up @@ -94,8 +95,9 @@ class NearestVersionLocator {
walk.parseCommit(id)
}

List tags = grgit.tag.list().collect { tag ->
[version: strategy.parseTag(tag), tag: tag, rev: toRev(tag)]
List tagRefs = grgit.repository.jgit.tagList().call()
List tags = tagRefs.collect { ref ->
[version: strategy.parseTag(new Tag(fullName: ref.name)), rev: walk.parseCommit(ref.getObjectId())]
}.findAll {
it.version
}
Expand Down

0 comments on commit c952f6d

Please sign in to comment.