File tree Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -83,15 +83,15 @@ export class GitUri extends Uri {
8383
8484 if ( ! git . isTrackable ( uri ) ) return new GitUri ( uri , git . repoPath ) ;
8585
86- const gitUri = git . getGitUriForFile ( uri . fsPath ) ;
87- if ( gitUri ) return gitUri ;
88-
8986 // If this is a git uri, assume it is showing the most recent commit
90- if ( uri . scheme === DocumentSchemes . Git && uri . query === '~' ) {
87+ if ( uri . scheme === DocumentSchemes . Git ) {
9188 const commit = await git . getLogCommit ( undefined , uri . fsPath ) ;
92- if ( commit ) return new GitUri ( uri , commit ) ;
89+ if ( commit !== undefined ) return new GitUri ( uri , commit ) ;
9390 }
9491
92+ const gitUri = git . getGitUriForFile ( uri . fsPath ) ;
93+ if ( gitUri ) return gitUri ;
94+
9595 return new GitUri ( uri , ( await git . getRepoPathFromFile ( uri . fsPath ) ) || git . repoPath ) ;
9696 }
9797
Original file line number Diff line number Diff line change @@ -339,19 +339,6 @@ export class GitService extends Disposable {
339339 Logger . log ( `Cached(${ key } ): getBlameForFile('${ uri . repoPath } ', '${ uri . fsPath } ', ${ uri . sha } )` ) ;
340340 return cachedBlame . item ;
341341 }
342-
343- if ( key !== 'blame' ) {
344- // Since we are looking for partial blame, see if we have the blame of the whole file
345- const cachedBlame = entry . get < ICachedBlame > ( 'blame' ) ;
346- if ( cachedBlame !== undefined ) {
347- Logger . log ( `? Cache(${ key } ): getBlameForFile('${ uri . repoPath } ', '${ uri . fsPath } ', ${ uri . sha } )` ) ;
348- const blame = await cachedBlame . item ;
349- if ( blame !== undefined && blame . commits . has ( uri . sha ! ) ) {
350- Logger . log ( `Cached(${ key } ): getBlameForFile('${ uri . repoPath } ', '${ uri . fsPath } ', ${ uri . sha } )` ) ;
351- return cachedBlame . item ;
352- }
353- }
354- }
355342 }
356343
357344 Logger . log ( `Not Cached(${ key } ): getBlameForFile('${ uri . repoPath } ', '${ uri . fsPath } ', ${ uri . sha } )` ) ;
You can’t perform that action at this time.
0 commit comments