diff options
Diffstat (limited to 'vendor/code.gitea.io')
-rw-r--r-- | vendor/code.gitea.io/git/repo_tag.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/vendor/code.gitea.io/git/repo_tag.go b/vendor/code.gitea.io/git/repo_tag.go index 11f1f3da73..77867f46c1 100644 --- a/vendor/code.gitea.io/git/repo_tag.go +++ b/vendor/code.gitea.io/git/repo_tag.go @@ -103,26 +103,18 @@ func (repo *Repository) GetTagInfos() ([]*Tag, error) { } tagNames := strings.Split(stdout, "\n") - var tags []*Tag + var tags = make([]*Tag, 0, len(tagNames)) for _, tagName := range tagNames { tagName = strings.TrimSpace(tagName) if len(tagName) == 0 { continue } - commitID, err := NewCommand("rev-parse", tagName).RunInDir(repo.Path) - if err != nil { - return nil, err - } - commit, err := repo.GetCommit(commitID) + + tag, err := repo.GetTag(tagName) if err != nil { return nil, err } - tags = append(tags, &Tag{ - Name: tagName, - Message: commit.Message(), - Object: commit.ID, - Tagger: commit.Author, - }) + tags = append(tags, tag) } sortTagsByTime(tags) return tags, nil |