1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-29 12:58:29 +00:00

Fix various bugs (#35177)

* Fix #35144
* Fix #35117
* Fix https://github.com/go-gitea/gitea/issues/35054#issuecomment-3131793977
* Fix #35136
This commit is contained in:
wxiaoguang
2025-07-30 15:08:59 +08:00
committed by GitHub
parent b7d8fade72
commit 85b5877bb0
11 changed files with 84 additions and 33 deletions

View File

@@ -90,11 +90,8 @@ func GetTreeBySHA(ctx context.Context, repo *repo_model.Repository, gitRepo *git
if rangeStart >= len(entries) {
return tree, nil
}
var rangeEnd int
if len(entries) > perPage {
tree.Truncated = true
}
rangeEnd = min(rangeStart+perPage, len(entries))
rangeEnd := min(rangeStart+perPage, len(entries))
tree.Truncated = rangeEnd < len(entries)
tree.Entries = make([]api.GitEntry, rangeEnd-rangeStart)
for e := rangeStart; e < rangeEnd; e++ {
i := e - rangeStart