mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Decouple diff stats query from actual diffing (#33810)
The diff stats are no longer part of the diff generation. Use `GetDiffShortStat` instead to get the total number of changed files, added lines, and deleted lines. As such, `gitdiff.GetDiff` can be simplified: It should not do more than expected. And do not run "git diff --shortstat" for pull list. Fix #31492
This commit is contained in:
@@ -423,7 +423,7 @@ func DiffPreviewPost(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if diff.NumFiles != 0 {
|
||||
if len(diff.Files) != 0 {
|
||||
ctx.Data["File"] = diff.Files[0]
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user