@@ -35,7 +35,7 @@ import { isGitUri } from '../../../git/gitUri';
3535import { encodeGitLensRevisionUriAuthority } from '../../../git/gitUri.authority' ;
3636import type { GitBlame , GitBlameAuthor , GitBlameLine } from '../../../git/models/blame' ;
3737import type { GitCommit } from '../../../git/models/commit' ;
38- import type { GitDiffFile , GitDiffLine } from '../../../git/models/diff' ;
38+ import type { GitLineDiff , ParsedGitDiffHunks } from '../../../git/models/diff' ;
3939import type { GitLog } from '../../../git/models/log' ;
4040import type { GitBranchReference , GitReference } from '../../../git/models/reference' ;
4141import type { GitRemote } from '../../../git/models/remote' ;
@@ -95,7 +95,7 @@ import { StatusGitSubProvider } from './sub-providers/status';
9595import { TagsGitSubProvider } from './sub-providers/tags' ;
9696import { WorktreesGitSubProvider } from './sub-providers/worktrees' ;
9797
98- const emptyPromise : Promise < GitBlame | GitDiffFile | GitLog | undefined > = Promise . resolve ( undefined ) ;
98+ const emptyPromise : Promise < GitBlame | ParsedGitDiffHunks | GitLog | undefined > = Promise . resolve ( undefined ) ;
9999const slash = 47 ;
100100
101101const RepoSearchWarnings = {
@@ -1696,7 +1696,11 @@ export class LocalGitProvider implements GitProvider, Disposable {
16961696 }
16971697
16981698 @log ( )
1699- async getDiffForFile ( uri : GitUri , ref1 : string | undefined , ref2 ?: string ) : Promise < GitDiffFile | undefined > {
1699+ async getDiffForFile (
1700+ uri : GitUri ,
1701+ ref1 : string | undefined ,
1702+ ref2 ?: string ,
1703+ ) : Promise < ParsedGitDiffHunks | undefined > {
17001704 const scope = getLogScope ( ) ;
17011705
17021706 let key = 'diff' ;
@@ -1738,7 +1742,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
17381742 Logger . debug ( scope , `Cache add: '${ key } '` ) ;
17391743
17401744 const value : CachedDiff = {
1741- item : promise as Promise < GitDiffFile > ,
1745+ item : promise as Promise < ParsedGitDiffHunks > ,
17421746 } ;
17431747 doc . state . setDiff ( key , value ) ;
17441748 }
@@ -1755,7 +1759,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
17551759 document : TrackedGitDocument ,
17561760 key : string ,
17571761 scope : LogScope | undefined ,
1758- ) : Promise < GitDiffFile | undefined > {
1762+ ) : Promise < ParsedGitDiffHunks | undefined > {
17591763 const [ relativePath , root ] = splitPath ( path , repoPath ) ;
17601764
17611765 try {
@@ -1776,20 +1780,20 @@ export class LocalGitProvider implements GitProvider, Disposable {
17761780 Logger . debug ( scope , `Cache replace (with empty promise): '${ key } '` ) ;
17771781
17781782 const value : CachedDiff = {
1779- item : emptyPromise as Promise < GitDiffFile > ,
1783+ item : emptyPromise as Promise < ParsedGitDiffHunks > ,
17801784 errorMessage : msg ,
17811785 } ;
17821786 document . state . setDiff ( key , value ) ;
17831787
1784- return emptyPromise as Promise < GitDiffFile > ;
1788+ return emptyPromise as Promise < ParsedGitDiffHunks > ;
17851789 }
17861790
17871791 return undefined ;
17881792 }
17891793 }
17901794
17911795 @log < LocalGitProvider [ 'getDiffForFileContents' ] > ( { args : { 1 : '<contents>' } } )
1792- async getDiffForFileContents ( uri : GitUri , ref : string , contents : string ) : Promise < GitDiffFile | undefined > {
1796+ async getDiffForFileContents ( uri : GitUri , ref : string , contents : string ) : Promise < ParsedGitDiffHunks | undefined > {
17931797 const scope = getLogScope ( ) ;
17941798
17951799 const key = `diff:${ md5 ( contents ) } ` ;
@@ -1825,7 +1829,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
18251829 Logger . debug ( scope , `Cache add: '${ key } '` ) ;
18261830
18271831 const value : CachedDiff = {
1828- item : promise as Promise < GitDiffFile > ,
1832+ item : promise as Promise < ParsedGitDiffHunks > ,
18291833 } ;
18301834 doc . state . setDiff ( key , value ) ;
18311835 }
@@ -1842,7 +1846,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
18421846 document : TrackedGitDocument ,
18431847 key : string ,
18441848 scope : LogScope | undefined ,
1845- ) : Promise < GitDiffFile | undefined > {
1849+ ) : Promise < ParsedGitDiffHunks | undefined > {
18461850 const [ relativePath , root ] = splitPath ( path , repoPath ) ;
18471851
18481852 try {
@@ -1861,12 +1865,12 @@ export class LocalGitProvider implements GitProvider, Disposable {
18611865 Logger . debug ( scope , `Cache replace (with empty promise): '${ key } '` ) ;
18621866
18631867 const value : CachedDiff = {
1864- item : emptyPromise as Promise < GitDiffFile > ,
1868+ item : emptyPromise as Promise < ParsedGitDiffHunks > ,
18651869 errorMessage : msg ,
18661870 } ;
18671871 document . state . setDiff ( key , value ) ;
18681872
1869- return emptyPromise as Promise < GitDiffFile > ;
1873+ return emptyPromise as Promise < ParsedGitDiffHunks > ;
18701874 }
18711875
18721876 return undefined ;
@@ -1879,7 +1883,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
18791883 editorLine : number , // 0-based, Git is 1-based
18801884 ref1 : string | undefined ,
18811885 ref2 ?: string ,
1882- ) : Promise < GitDiffLine | undefined > {
1886+ ) : Promise < GitLineDiff | undefined > {
18831887 try {
18841888 const diff = await this . getDiffForFile ( uri , ref1 , ref2 ) ;
18851889 if ( diff == null ) return undefined ;
0 commit comments