Repository.close

fixes #35041
This commit is contained in:
Joao Moreno
2017-09-28 11:09:30 +02:00
parent 38551e71b4
commit a13fdcbf50
6 changed files with 88 additions and 26 deletions

View File

@@ -230,6 +230,16 @@ export class Model {
this._onDidOpenRepository.fire(repository);
}
close(repository: Repository): void {
const openRepository = this.getOpenRepository(repository);
if (!openRepository) {
return;
}
openRepository.dispose();
}
async pickRepository(): Promise<Repository | undefined> {
if (this.openRepositories.length === 0) {
throw new Error(localize('no repositories', "There are no available repositories"));