extensions/git/src/statusbar.ts/SyncStatusBar/command
class SyncStatusBar:	get command(): Command | undefined {
		if (!this.state.enabled) {
			return;
		}

		if (!this.state.hasRemotes) {
			if (this.state.remoteSourceProviders.length === 0) {
				return;
			}

			const tooltip = this.state.remoteSourceProviders.length === 1
				? localize('publish to', "Publish to {0}", this.state.remoteSourceProviders[0].name)
				: localize('publish to...', "Publish to...");

			return {
				command: 'git.publish',
				title: `$(cloud-upload)`,
				tooltip,
				arguments: [this.repository.sourceControl]
			};
		}

		const HEAD = this.state.HEAD;
		let icon = '$(sync)';
		let text = '';
		let command = '';
		let tooltip = '';

		if (HEAD && HEAD.name && HEAD.commit) {
			if (HEAD.upstream) {
				if (HEAD.ahead || HEAD.behind) {
					text += this.repository.syncLabel;
				}

				const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
				const rebaseWhenSync = config.get<string>('rebaseWhenSync');

				command = rebaseWhenSync ? 'git.syncRebase' : 'git.sync';
				tooltip = this.repository.syncTooltip;
			} else {
				icon = '$(cloud-upload)';
				command = 'git.publish';
				tooltip = localize('publish changes', "Publish Changes");
			}
		} else {
			command = '';
			tooltip = '';
		}

		if (this.state.isSyncRunning) {
			icon = '$(sync~spin)';
			command = '';
			tooltip = localize('syncing changes', "Synchronizing Changes...");
		}

		return {
			command,
			title: [icon, text].join(' ').trim(),
			tooltip,
			arguments: [this.repository.sourceControl]
		};
	}