0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-11-21 12:00:40 +00:00

fix: also apply tag filter to last tag fetching

issue: #45
This commit is contained in:
hypervtechnics 2022-04-04 08:25:17 +02:00
parent 2adacd62ef
commit 00c843df2d

View File

@ -82,8 +82,8 @@ func NewGit(messageProcessor MessageProcessor, cfg TagConfig) *GitImpl {
}
// LastTag get last tag, if no tag found, return empty.
func (GitImpl) LastTag() string {
cmd := exec.Command("git", "for-each-ref", "refs/tags", "--sort", "-creatordate", "--format", "%(refname:short)", "--count", "1")
func (g GitImpl) LastTag() string {
cmd := exec.Command("git", "for-each-ref", "refs/tags/" + g.tagCfg.Filter, "--sort", "-creatordate", "--format", "%(refname:short)", "--count", "1")
out, err := cmd.CombinedOutput()
if err != nil {
return ""