src/vs/workbench/contrib/scm/browser/scmViewService.ts/SCMViewService/onDidRemoveRepository
class SCMViewService:	private onDidRemoveRepository(repository: ISCMRepository): void {
		if (!this.didFinishLoading) {
			this.eventuallyFinishLoading();
		}

		let added: Iterable<ISCMRepository> = Iterable.empty();

		const repositoriesIndex = this._repositories.indexOf(repository);
		const visibleRepositoriesIndex = this._visibleRepositories.indexOf(repository);

		if (repositoriesIndex > -1) {
			this._repositories.splice(repositoriesIndex, 1);
		}

		if (visibleRepositoriesIndex > -1) {
			this._visibleRepositories.splice(visibleRepositoriesIndex, 1);
			this._visibleRepositoriesSet.delete(repository);

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

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

		if (repositoriesIndex > -1 || visibleRepositoriesIndex > -1) {
			this._onDidChangeRepositories.fire({ added, removed: [repository] });
		}

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