File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -499,8 +499,9 @@ export async function getChangedFilesDetailed(
499499 continue ;
500500 }
501501 try {
502- const unstaged = await git . diff ( [ file ] ) ;
503- const lines = unstaged . split ( "\n" ) ;
502+ const headDiff = await git . diff ( [ "HEAD" , "--" , file ] ) ;
503+ if ( ! headDiff . trim ( ) ) continue ;
504+ const lines = headDiff . split ( "\n" ) ;
504505 const linesAdded = lines . filter (
505506 ( l ) => l . startsWith ( "+" ) && ! l . startsWith ( "+++" ) ,
506507 ) . length ;
@@ -525,6 +526,10 @@ export async function getChangedFilesDetailed(
525526 ) {
526527 continue ;
527528 }
529+ try {
530+ const headDiff = await git . diff ( [ "HEAD" , "--" , file ] ) ;
531+ if ( ! headDiff . trim ( ) ) continue ;
532+ } catch { }
528533 files . push ( {
529534 path : file ,
530535 status : "deleted" ,
You can’t perform that action at this time.
0 commit comments