File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ export async function parseDiff(
355355 continue ;
356356 }
357357
358- const diffHunks = review . patch ? parsePatch ( review . patch ) : [ ] ;
358+ const diffHunks = review . patch ? parsePatch ( review . patch ) : undefined ;
359359 fileChanges . push (
360360 new InMemFileChange (
361361 parentCommit ,
@@ -364,7 +364,7 @@ export async function parseDiff(
364364 review . previous_filename ,
365365 review . patch ?? '' ,
366366 diffHunks ,
367- review . blob_url ,
367+ review . blob_url
368368 ) ,
369369 ) ;
370370 }
Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ export class InMemFileChange implements SimpleFileChange {
3030 public readonly fileName : string ,
3131 public readonly previousFileName : string | undefined ,
3232 public readonly patch : string ,
33- public readonly diffHunks : DiffHunk [ ] ,
33+ public readonly diffHunks : DiffHunk [ ] | undefined ,
3434 public readonly blobUrl : string ,
35- ) { }
35+ ) { }
3636}
3737
3838export class SlimFileChange implements SimpleFileChange {
@@ -42,5 +42,5 @@ export class SlimFileChange implements SimpleFileChange {
4242 public readonly status : GitChangeType ,
4343 public readonly fileName : string ,
4444 public readonly previousFileName : string | undefined ,
45- ) { }
45+ ) { }
4646}
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export abstract class FileChangeModel {
5151 async diffHunks ( ) : Promise < DiffHunk [ ] > {
5252 let diffHunks : DiffHunk [ ] = [ ] ;
5353
54- if ( this . change instanceof InMemFileChange ) {
54+ if ( this . change instanceof InMemFileChange && this . change . diffHunks ) {
5555 return this . change . diffHunks ;
5656 } else if ( this . status !== GitChangeType . RENAME ) {
5757 try {
You can’t perform that action at this time.
0 commit comments