src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.ts/RepositoryRenderer/renderElement
class RepositoryRenderer:	renderElement(arg: ISCMRepository | ITreeNode<ISCMRepository, FuzzyScore>, index: number, templateData: RepositoryTemplate, height: number | undefined): void {
		templateData.disposable.dispose();

		const disposables = new DisposableStore();
		const repository = isSCMRepository(arg) ? arg : arg.element;

		if (repository.provider.rootUri) {
			const folder = this.workspaceContextService.getWorkspaceFolder(repository.provider.rootUri);

			if (folder?.uri.toString() === repository.provider.rootUri.toString()) {
				templateData.name.textContent = folder.name;
			} else {
				templateData.name.textContent = basename(repository.provider.rootUri);
			}

			templateData.label.title = `${repository.provider.label}: ${repository.provider.rootUri.fsPath}`;
			templateData.description.textContent = repository.provider.label;
		} else {
			templateData.label.title = repository.provider.label;
			templateData.name.textContent = repository.provider.label;
			templateData.description.textContent = '';
		}

		let statusPrimaryActions: IAction[] = [];
		let menuPrimaryActions: IAction[] = [];
		let menuSecondaryActions: IAction[] = [];
		const updateToolbar = () => {
			templateData.toolBar.setActions([...statusPrimaryActions, ...menuPrimaryActions], menuSecondaryActions);
		};

		const onDidChangeProvider = () => {
			const commands = repository.provider.statusBarCommands || [];
			statusPrimaryActions = commands.map(c => new StatusBarAction(c, this.commandService));
			updateToolbar();

			const count = repository.provider.count || 0;
			templateData.countContainer.setAttribute('data-count', String(count));
			templateData.count.setCount(count);
		};

		// TODO@joao TODO@lszomoru
		let disposed = false;
		disposables.add(toDisposable(() => disposed = true));
		disposables.add(repository.provider.onDidChange(() => {
			if (disposed) {
				return;
			}

			onDidChangeProvider();
		}));

		onDidChangeProvider();

		const menus = this.scmViewService.menus.getRepositoryMenus(repository.provider);
		disposables.add(connectPrimaryMenu(menus.titleMenu.menu, (primary, secondary) => {
			menuPrimaryActions = primary;
			menuSecondaryActions = secondary;
			updateToolbar();
		}));
		templateData.toolBar.context = repository.provider;

		templateData.disposable = disposables;
	}