1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

Fixes #7292 - API File Contents bug (#7301)

This commit is contained in:
Richard Mahn
2019-06-29 16:51:10 -04:00
committed by techknowlogick
parent 738285a4aa
commit cd96dee982
17 changed files with 963 additions and 335 deletions

View File

@@ -17,8 +17,8 @@ import (
// GetFileResponseFromCommit Constructs a FileResponse from a Commit object
func GetFileResponseFromCommit(repo *models.Repository, commit *git.Commit, branch, treeName string) (*api.FileResponse, error) {
fileContents, _ := GetFileContents(repo, treeName, branch) // ok if fails, then will be nil
fileCommitResponse, _ := GetFileCommitResponse(repo, commit) // ok if fails, then will be nil
fileContents, _ := GetContents(repo, treeName, branch, false) // ok if fails, then will be nil
fileCommitResponse, _ := GetFileCommitResponse(repo, commit) // ok if fails, then will be nil
verification := GetPayloadCommitVerification(commit)
fileResponse := &api.FileResponse{
Content: fileContents,