git: repository == scm provider

This commit is contained in:
Joao Moreno
2017-08-15 18:03:47 +02:00
parent 56d1dadf05
commit fe8ee2e7b8
8 changed files with 341 additions and 437 deletions

View File

@@ -30,9 +30,9 @@ export class GitContentProvider {
private cache: Cache = Object.create(null);
private disposables: Disposable[] = [];
constructor(private model: Repository) {
constructor(private repository: Repository) {
this.disposables.push(
model.onDidChangeRepository(this.eventuallyFireChangeEvents, this),
repository.onDidChangeRepository(this.eventuallyFireChangeEvents, this),
workspace.registerTextDocumentContentProvider('git', this)
);
@@ -61,12 +61,12 @@ export class GitContentProvider {
if (ref === '~') {
const fileUri = Uri.file(path);
const uriString = fileUri.toString();
const [indexStatus] = this.model.indexGroup.resources.filter(r => r.original.toString() === uriString);
const [indexStatus] = this.repository.indexGroup.resourceStates.filter(r => r.original.toString() === uriString);
ref = indexStatus ? '' : 'HEAD';
}
try {
return await this.model.show(ref, path);
return await this.repository.show(ref, path);
} catch (err) {
return '';
}