File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,17 @@ async function getPullRequestEditedDiffRanges(
298298 if ( filediffs === undefined ) {
299299 return undefined ;
300300 }
301+ if ( filediffs . length >= 300 ) {
302+ // The "compare two commits" API returns a maximum of 300 changed files. If
303+ // we see that many changed files, it is possible that there could be more,
304+ // with the rest being truncated. In this case, we should not attempt to
305+ // compute the diff ranges, as the result would be incomplete.
306+ logger . warning (
307+ `Cannot retrieve the full diff because there are too many ` +
308+ `(${ filediffs . length } ) changed files in the pull request.` ,
309+ ) ;
310+ return undefined ;
311+ }
301312 const results : DiffThunkRange [ ] = [ ] ;
302313 for ( const filediff of filediffs ) {
303314 const diffRanges = getDiffRanges ( filediff , logger ) ;
You can’t perform that action at this time.
0 commit comments