Switches to use GitUris in more places

This commit is contained in:
Eric Amodio
2017-05-25 01:05:18 -04:00
parent 9c7062020e
commit efd3d40aa8
4 changed files with 29 additions and 38 deletions

View File

@@ -62,8 +62,8 @@ export class GitContextTracker extends Disposable {
}
private _onBlameFailed(key: string) {
const fileName = this._editor && this._editor.document && this._editor.document.fileName;
if (!fileName || key !== this.git.getCacheEntryKey(fileName)) return;
if (this._editor === undefined || this._editor.document === undefined || this._editor.document.uri === undefined) return;
if (key !== this.git.getCacheEntryKey(this._editor.document.uri)) return;
this._updateBlameability(false);
}

View File

@@ -89,7 +89,7 @@ export class GitUri extends Uri {
if (commit !== undefined) return new GitUri(uri, commit);
}
const gitUri = git.getGitUriForFile(uri.fsPath);
const gitUri = git.getGitUriForFile(uri);
if (gitUri) return gitUri;
return new GitUri(uri, (await git.getRepoPathFromFile(uri.fsPath)) || git.repoPath);