Skip to content

Commit 8775a5a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into localize-heatmap
2 parents 55b2f28 + 8430f73 commit 8775a5a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

routers/api/v1/repo/pull.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,11 @@ func GetPullRequestFiles(ctx *context.APIContext) {
14431443
end = totalNumberOfFiles
14441444
}
14451445

1446-
apiFiles := make([]*api.ChangedFile, 0, end-start)
1446+
lenFiles := end - start
1447+
if lenFiles < 0 {
1448+
lenFiles = 0
1449+
}
1450+
apiFiles := make([]*api.ChangedFile, 0, lenFiles)
14471451
for i := start; i < end; i++ {
14481452
apiFiles = append(apiFiles, convert.ToChangedFile(diff.Files[i], pr.HeadRepo, endCommitID))
14491453
}

0 commit comments

Comments
 (0)