git file system should wait for model to be initialized

This commit is contained in:
João Moreno
2020-06-10 15:44:53 +02:00
parent 4b15134df1
commit 24f1b69a90
3 changed files with 16 additions and 2 deletions

View File

@@ -133,6 +133,8 @@ export class GitFileSystemProvider implements FileSystemProvider {
}
async stat(uri: Uri): Promise<FileStat> {
await this.model.isInitialized;
const { submoduleOf, path, ref } = fromGitUri(uri);
const repository = submoduleOf ? this.model.getRepository(submoduleOf) : this.model.getRepository(uri);
if (!repository) {
@@ -158,6 +160,8 @@ export class GitFileSystemProvider implements FileSystemProvider {
}
async readFile(uri: Uri): Promise<Uint8Array> {
await this.model.isInitialized;
const { path, ref, submoduleOf } = fromGitUri(uri);
if (submoduleOf) {