diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-02-07 20:00:52 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-02-07 12:00:52 +0000 |
commit | 01bbf5ea6940a1dc3793aaae2db2d85b1769432c (patch) | |
tree | 9bd5dbc9d0ffab32ec93334ad3f7e7eebe67a338 /vendor/code.gitea.io | |
parent | 2d213b64d1c897d7a0fdbc93e5cab90f84d7334a (diff) | |
download | gitea-01bbf5ea6940a1dc3793aaae2db2d85b1769432c.tar.gz gitea-01bbf5ea6940a1dc3793aaae2db2d85b1769432c.zip |
Add API to list tags (#5850)
* Add API to list tags
* update dependency gitea sdk vendor
* fix swagger generation
* fix swagger
* add tests
* update code.gitea.io/git vendor
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 |