extensions/git/src/repository.ts/Repository/_updateModelState
class Repository:	private async _updateModelState(optimisticResourcesGroups?: GitResourceGroups, cancellationToken?: CancellationToken): Promise<void> {
		try {
			// Optimistically update resource groups
			if (optimisticResourcesGroups) {
				this._updateResourceGroupsState(optimisticResourcesGroups);
			}

			const [HEAD, remotes, submodules, rebaseCommit, mergeInProgress, commitTemplate] =
				await Promise.all([
					this.repository.getHEADBranch(),
					this.repository.getRemotes(),
					this.repository.getSubmodules(),
					this.getRebaseCommit(),
					this.isMergeInProgress(),
					this.getInputTemplate()]);

			this._HEAD = HEAD;
			this._remotes = remotes!;
			this._submodules = submodules!;
			this.rebaseCommit = rebaseCommit;
			this.mergeInProgress = mergeInProgress;

			this._sourceControl.commitTemplate = commitTemplate;

			// Execute cancellable long-running operations
			const config = workspace.getConfiguration('git');
			let sort = config.get<'alphabetically' | 'committerdate'>('branchSortOrder') || 'alphabetically';
			if (sort !== 'alphabetically' && sort !== 'committerdate') {
				sort = 'alphabetically';
			}

			const [resourceGroups, refs] =
				await Promise.all([
					this.getStatus(cancellationToken),
					this.repository.getRefs({ sort, cancellationToken })]);

			this._refs = refs!;
			this._updateResourceGroupsState(resourceGroups);

			this._onDidChangeStatus.fire();
		}
		catch (err) {
			if (err instanceof CancellationError) {
				return;
			}

			throw err;
		}
	}