Fix zero created time bug on commit api (#17547)
Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		
							parent
							
								
									e8cf04bad7
								
							
						
					
					
						commit
						f25f7c592f
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -147,8 +147,9 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string] | ||||||
| 
 | 
 | ||||||
| 	return &api.Commit{ | 	return &api.Commit{ | ||||||
| 		CommitMeta: &api.CommitMeta{ | 		CommitMeta: &api.CommitMeta{ | ||||||
| 			URL: repo.APIURL() + "/git/commits/" + commit.ID.String(), | 			URL:     repo.APIURL() + "/git/commits/" + commit.ID.String(), | ||||||
| 			SHA: commit.ID.String(), | 			SHA:     commit.ID.String(), | ||||||
|  | 			Created: commit.Committer.When, | ||||||
| 		}, | 		}, | ||||||
| 		HTMLURL: repo.HTMLURL() + "/commit/" + commit.ID.String(), | 		HTMLURL: repo.HTMLURL() + "/commit/" + commit.ID.String(), | ||||||
| 		RepoCommit: &api.RepoCommit{ | 		RepoCommit: &api.RepoCommit{ | ||||||
|  | @ -169,8 +170,9 @@ func ToCommit(repo *models.Repository, commit *git.Commit, userCache map[string] | ||||||
| 			}, | 			}, | ||||||
| 			Message: commit.Message(), | 			Message: commit.Message(), | ||||||
| 			Tree: &api.CommitMeta{ | 			Tree: &api.CommitMeta{ | ||||||
| 				URL: repo.APIURL() + "/git/trees/" + commit.ID.String(), | 				URL:     repo.APIURL() + "/git/trees/" + commit.ID.String(), | ||||||
| 				SHA: commit.ID.String(), | 				SHA:     commit.ID.String(), | ||||||
|  | 				Created: commit.Committer.When, | ||||||
| 			}, | 			}, | ||||||
| 		}, | 		}, | ||||||
| 		Author:    apiAuthor, | 		Author:    apiAuthor, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue