Fixes issue with blame on versioned files

Stops falling back to the cached blame of the working file
Handles git scheme urls properly
This commit is contained in:
Eric Amodio
2017-05-25 00:46:39 -04:00
parent 9da80c121b
commit 9c7062020e
2 changed files with 6 additions and 19 deletions

View File

@@ -83,15 +83,15 @@ export class GitUri extends Uri {
if (!git.isTrackable(uri)) return new GitUri(uri, git.repoPath);
// If this is a git uri, assume it is showing the most recent commit
if (uri.scheme === DocumentSchemes.Git) {
const commit = await git.getLogCommit(undefined, uri.fsPath);
if (commit !== undefined) return new GitUri(uri, commit);
}
const gitUri = git.getGitUriForFile(uri.fsPath);
if (gitUri) return gitUri;
// If this is a git uri, assume it is showing the most recent commit
if (uri.scheme === DocumentSchemes.Git && uri.query === '~') {
const commit = await git.getLogCommit(undefined, uri.fsPath);
if (commit) return new GitUri(uri, commit);
}
return new GitUri(uri, (await git.getRepoPathFromFile(uri.fsPath)) || git.repoPath);
}