0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-10 13:31:01 -05:00

Fix viewed files number is not right if not all files loaded (#35821)

Fix #35803

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
Lunny Xiao
2025-11-03 13:34:52 -08:00
committed by GitHub
parent d9c0f86de8
commit de26c8acce
4 changed files with 24 additions and 8 deletions

View File

@@ -520,10 +520,9 @@ func getCommitFileLineCountAndLimitedContent(commit *git.Commit, filePath string
// Diff represents a difference between two git trees.
type Diff struct {
Start, End string
Files []*DiffFile
IsIncomplete bool
NumViewedFiles int // user-specific
Start, End string
Files []*DiffFile
IsIncomplete bool
}
// LoadComments loads comments into each line
@@ -1412,7 +1411,6 @@ outer:
// Check whether the file has already been viewed
if fileViewedState == pull_model.Viewed {
diffFile.IsViewed = true
diff.NumViewedFiles++
}
}