mirror of
https://github.com/go-gitea/gitea
synced 2025-07-19 08:48:37 +00:00
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
This commit is contained in:
@@ -34,6 +34,22 @@ func ToBranch(repo *models.Repository, b *models.Branch, c *git.Commit) *api.Bra
|
||||
}
|
||||
}
|
||||
|
||||
// ToTag convert a tag to an api.Tag
|
||||
func ToTag(repo *models.Repository, t *git.Tag) *api.Tag {
|
||||
return &api.Tag{
|
||||
Name: t.Name,
|
||||
Commit: struct {
|
||||
SHA string `json:"sha"`
|
||||
URL string `json:"url"`
|
||||
}{
|
||||
SHA: t.ID.String(),
|
||||
URL: util.URLJoin(repo.Link(), "commit", t.ID.String()),
|
||||
},
|
||||
ZipballURL: util.URLJoin(repo.Link(), "archive", t.Name+".zip"),
|
||||
TarballURL: util.URLJoin(repo.Link(), "archive", t.Name+".tar.gz"),
|
||||
}
|
||||
}
|
||||
|
||||
// ToCommit convert a commit to api.PayloadCommit
|
||||
func ToCommit(repo *models.Repository, c *git.Commit) *api.PayloadCommit {
|
||||
authorUsername := ""
|
||||
|
Reference in New Issue
Block a user