File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/env/node/git/sub-providers Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -576,10 +576,6 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
576
576
currentPath = relativePath ;
577
577
rev = '' ;
578
578
}
579
- } else if ( ! skipFirstRev ) {
580
- currentSha = '' ;
581
- currentPath = relativePath ;
582
- rev = '' ;
583
579
}
584
580
} else if ( ! skipFirstRev ) {
585
581
currentSha = rev ;
@@ -635,6 +631,11 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
635
631
for ( const commit of parser . parse ( result . stdout ) ) {
636
632
const path = relativePath ;
637
633
file = commit . files . find ( f => f . path === path || f . originalPath === path ) ;
634
+ // If we couldn't find the file, but there is only one file in the commit, use that one and assume the filename changed
635
+ if ( file == null && commit . files . length === 1 ) {
636
+ file = commit . files [ 0 ] ;
637
+ relativePath = file . path ;
638
+ }
638
639
// Keep track of the file changing paths
639
640
if ( file ?. originalPath && file . originalPath !== relativePath ) {
640
641
relativePath = file . originalPath ;
You can’t perform that action at this time.
0 commit comments