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

Fix #35803
Backport #35821

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
Lunny Xiao
2025-11-03 17:19:50 -08:00
committed by GitHub
parent 0a9cbf3228
commit 8116742e2d
4 changed files with 24 additions and 8 deletions

View File

@@ -449,10 +449,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
@@ -1342,7 +1341,6 @@ outer:
// Check whether the file has already been viewed
if fileViewedState == pull_model.Viewed {
diffFile.IsViewed = true
diff.NumViewedFiles++
}
}