1
0
Fork 0
forked from forgejo/forgejo

[#13004] Add Timestamp to Tag list API (#13026)

* Add Timestamp to Tag list API

* Add unit test for ToCommitMeta

* Rename timestamp to created

* Reformat files
This commit is contained in:
Lucas Queiroz 2020-10-05 01:07:54 -03:00 committed by GitHub
parent 48703c3c68
commit 67a5573310
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 2 deletions

View file

@ -28,8 +28,9 @@ func ToCommitUser(sig *git.Signature) *api.CommitUser {
// ToCommitMeta convert a git.Tag to an api.CommitMeta
func ToCommitMeta(repo *models.Repository, tag *git.Tag) *api.CommitMeta {
return &api.CommitMeta{
SHA: tag.Object.String(),
URL: util.URLJoin(repo.APIURL(), "git/commits", tag.ID.String()),
SHA: tag.Object.String(),
URL: util.URLJoin(repo.APIURL(), "git/commits", tag.ID.String()),
Created: tag.Tagger.When,
}
}