fix: backport various fixes (#39203, #39236, #39239, #39248, #39251) (#39252)

This commit is contained in:
wxiaoguang
2026-09-06 22:05:11 +08:00
committed by GitHub
parent a127bc1013
commit bc11b8ac22
9 changed files with 159 additions and 16 deletions
+1 -1
View File
@@ -1617,7 +1617,7 @@ func GetPullRequestFiles(ctx *context.APIContext) {
limit = max(limit, 0)
apiFiles := make([]*api.ChangedFile, 0, limit)
for i := start; i < start+limit; i++ {
for i := start; i < start+limit && i < len(diff.Files); i++ {
// refs/pull/1/head stores the HEAD commit ID, allowing all related commits to be found in the base repository.
// The head repository might have been deleted, so we should not rely on it here.
apiFiles = append(apiFiles, convert.ToChangedFile(diff.Files[i], pr.BaseRepo, endCommitID))