Skip to content

Commit

Permalink
Fix zero created time bug on commit api (#17546)
Browse files Browse the repository at this point in the history
Fix #17543
  • Loading branch information
lunny authored Nov 5, 2021
1 parent de9625e commit a161c2c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/convert/git_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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,
Expand Down

0 comments on commit a161c2c

Please sign in to comment.