Fix zero created time bug on commit api (#17547)

Co-authored-by: zeripath <art27@cantab.net>
release/v1.15
Lunny Xiao 2021-11-05 14:15:44 +08:00 committed by GitHub
parent e8cf04bad7
commit f25f7c592f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -149,6 +149,7 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
CommitMeta: &api.CommitMeta{
URL: repo.APIURL() + "/git/commits/" + commit.ID.String(),
SHA: commit.ID.String(),
Created: commit.Committer.When,
},
HTMLURL: repo.HTMLURL() + "/commit/" + commit.ID.String(),
RepoCommit: &api.RepoCommit{
@ -171,6 +172,7 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
Tree: &api.CommitMeta{
URL: repo.APIURL() + "/git/trees/" + commit.ID.String(),
SHA: commit.ID.String(),
Created: commit.Committer.When,
},
},
Author: apiAuthor,