summaryrefslogtreecommitdiffstats
path: root/modules/convert
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-05 13:30:46 +0800
committerGitHub <noreply@github.com>2021-11-05 05:30:46 +0000
commita161c2ca5834e950f35fa7546b027f825d4bb5eb (patch)
tree64cc9d450bb94e726e52a9554e4e0ce3d7640ea1 /modules/convert
parentde9625e48510c2e6ea65abfe50db6e552b655744 (diff)
downloadgitea-a161c2ca5834e950f35fa7546b027f825d4bb5eb.tar.gz
gitea-a161c2ca5834e950f35fa7546b027f825d4bb5eb.zip
Fix zero created time bug on commit api (#17546)
Fix #17543
Diffstat (limited to 'modules/convert')
-rw-r--r--modules/convert/git_commit.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/convert/git_commit.go b/modules/convert/git_commit.go
index fd4f12ecfa..9f43bb82f8 100644
--- a/modules/convert/git_commit.go
+++ b/modules/convert/git_commit.go
@@ -147,8 +147,9 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
return &api.Commit{
CommitMeta: &api.CommitMeta{
- URL: repo.APIURL() + "/git/commits/" + commit.ID.String(),
- SHA: commit.ID.String(),
+ 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{
@@ -169,8 +170,9 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string]
},
Message: commit.Message(),
Tree: &api.CommitMeta{
- URL: repo.APIURL() + "/git/trees/" + commit.ID.String(),
- SHA: commit.ID.String(),
+ URL: repo.APIURL() + "/git/trees/" + commit.ID.String(),
+ SHA: commit.ID.String(),
+ Created: commit.Committer.When,
},
},
Author: apiAuthor,