diff options
author | Lucas Queiroz <me@lucasqueiroz.dev> | 2020-10-05 01:07:54 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 12:07:54 +0800 |
commit | 67a5573310cf23726e3c2ef4651221c6dc150075 (patch) | |
tree | add7af9497a8d421fedaec36f1638fb70ab3b5ad /modules/convert/git_commit.go | |
parent | 48703c3c68ff3d948b406c422bc4f663da783d87 (diff) | |
download | gitea-67a5573310cf23726e3c2ef4651221c6dc150075.tar.gz gitea-67a5573310cf23726e3c2ef4651221c6dc150075.zip |
[#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
Diffstat (limited to 'modules/convert/git_commit.go')
-rw-r--r-- | modules/convert/git_commit.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/convert/git_commit.go b/modules/convert/git_commit.go index 55cbb3af80..86d6dae961 100644 --- a/modules/convert/git_commit.go +++ b/modules/convert/git_commit.go @@ -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, } } |