mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactoring of inline diff computing to prevent empty diff box. Fix #2489
This commit is contained in:
@@ -168,12 +168,6 @@ func Diff(ctx *middleware.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
for _, diffFile := range diff.Files {
|
||||
for _, diffSection := range diffFile.Sections {
|
||||
diffSection.ComputeLinesDiff()
|
||||
}
|
||||
}
|
||||
|
||||
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
|
||||
ctx.Data["Username"] = userName
|
||||
ctx.Data["Reponame"] = repoName
|
||||
|
@@ -349,12 +349,6 @@ func ViewPullFiles(ctx *middleware.Context) {
|
||||
ctx.Data["Diff"] = diff
|
||||
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
|
||||
|
||||
for _, diffFile := range diff.Files {
|
||||
for _, diffSection := range diffFile.Sections {
|
||||
diffSection.ComputeLinesDiff()
|
||||
}
|
||||
}
|
||||
|
||||
commit, err := gitRepo.GetCommit(endCommitID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetCommit", err)
|
||||
|
Reference in New Issue
Block a user