diff --git a/routers/hat/repo/pull_version.go b/routers/hat/repo/pull_version.go index 0527273..7bf8c99 100644 --- a/routers/hat/repo/pull_version.go +++ b/routers/hat/repo/pull_version.go @@ -117,10 +117,11 @@ func GetPullRequestVersionDiff(ctx *context.APIContext) { } targetDiffFile.Diff = strings.Join(afterStrings, "\n") } + targetDiffFile.DiffFile = file break } } - if targetDiffFile == nil { + if targetDiffFile.DiffFile == nil { ctx.NotFound() } else { ctx.JSON(http.StatusOK, targetDiffFile) diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index d2ec6b7..7d901b5 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -5,6 +5,6 @@ import ( ) type DiffFile struct { - gitea_gitdiff.DiffFile + *gitea_gitdiff.DiffFile Diff string }