extensions/git/src/actionButton.ts/ActionButtonCommand/button
class ActionButtonCommand:	get button(): SourceControlActionButton | undefined {
		if (!this.state.HEAD || !this.state.HEAD.name || !this.state.HEAD.commit) { return undefined; }

		const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
		const showActionButton = config.get<string>('showUnpublishedCommitsButton', 'whenEmpty');
		const postCommitCommand = config.get<string>('postCommitCommand');
		const noPostCommitCommand = postCommitCommand !== 'sync' && postCommitCommand !== 'push';

		let actionButton: SourceControlActionButton | undefined;
		if (showActionButton === 'always' || (showActionButton === 'whenEmpty' && this.state.repositoryHasNoChanges && noPostCommitCommand)) {
			if (this.state.HEAD.upstream) {
				if (this.state.HEAD.ahead) {
					const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
					const rebaseWhenSync = config.get<string>('rebaseWhenSync');

					const ahead = `${this.state.HEAD.ahead}$(arrow-up)`;
					const behind = this.state.HEAD.behind ? `${this.state.HEAD.behind}$(arrow-down) ` : '';
					const icon = this.state.isSyncRunning ? '$(sync~spin)' : '$(sync)';

					actionButton = {
						command: {
							command: this.state.isSyncRunning ? '' : rebaseWhenSync ? 'git.syncRebase' : 'git.sync',
							title: localize('scm button sync title', "{0} {1}{2}", icon, behind, ahead),
							tooltip: this.state.isSyncRunning ?
								localize('syncing changes', "Synchronizing Changes...")
								: this.repository.syncTooltip,
							arguments: [this.repository.sourceControl],
						},
						description: localize('scm button sync description', "{0} Sync Changes {1}{2}", icon, behind, ahead)
					};
				}
			} else {
				actionButton = {
					command: {
						command: this.state.isSyncRunning ? '' : 'git.publish',
						title: localize('scm button publish title', "$(cloud-upload) Publish Branch"),
						tooltip: this.state.isSyncRunning ?
							localize('scm button publish branch running', "Publishing Branch...") :
							localize('scm button publish branch', "Publish Branch"),
						arguments: [this.repository.sourceControl],
					}
				};
			}
		}

		return actionButton;
	}