src/vs/workbench/contrib/scm/browser/scmViewService.ts/SCMViewService/onDidRemoveRepository
class SCMViewService:	private onDidRemoveRepository(repository: ISCMRepository): void {
		this.logService.trace('SCMViewService#onDidRemoveRepository', getProviderStorageKey(repository.provider));

		if (!this.didFinishLoading) {
			this.eventuallyFinishLoading();
		}

		const index = this._visibleRepositories.indexOf(repository);

		if (index > -1) {
			let added: Iterable<ISCMRepository> = Iterable.empty();

			this._visibleRepositories.splice(index, 1);
			this._visibleRepositoriesSet.delete(repository);

			if (this._visibleRepositories.length === 0 && this.scmService.repositories.length > 0) {
				const first = this.scmService.repositories[0];

				this._visibleRepositories.push(first);
				this._visibleRepositoriesSet.add(first);
				added = [first];
			}

			this._onDidChangeRepositories.fire({ added, removed: [repository] });
		}

		if (this._focusedRepository === repository) {
			this.focus(this._visibleRepositories[0]);
		}
	}