Change:
Create a commit. While the commit runs, the sync button spins as if it's syncing . The one in the statusbar does not. !

Discussion:
interface ActionButtonState { readonly HEAD: Branch | undefined; <del> readonly isActionRunning: boolean; </del> <ins> readonly isCommitInProgress: boolean; readonly isSyncInProgress: boolean; </ins> readonly repositoryHasChanges: boolean; }

private disposables: Disposable[] = []; constructor(readonly repository: Repository) { <del> this._state = { HEAD: undefined, isActionRunning: false, repositoryHasChanges: false }; </del> <ins> this._state = { HEAD: undefined, isCommitInProgress: false, isSyncInProgress: false, repositoryHasChanges: false }; </ins> repository.onDidRunGitStatus(this.onDidRunGitStatus, this, this.disposables); repository.onDidChangeOperations(this.onDidChangeOperations, this, this.disposables);

switch (postCommitCommand) { case 'push': { title = localize('scm button commit and push title', "$(arrow-up) Commit & Push"); <del> tooltip = this.state.isActionRunning ? </del> <ins> tooltip = this.state.isCommitInProgress ? </ins> localize('scm button committing pushing tooltip', "Committing & Pushing Changes...") : localize('scm button commit push tooltip', "Commit & Push Changes"); break; } case 'sync': { title = localize('scm button commit and sync title', "$(sync) Commit & Sync"); <del> tooltip = this.state.isActionRunning ? </del> <ins> tooltip = this.state.isCommitInProgress ? </ins> localize('scm button committing synching tooltip', "Committing & Synching Changes...") : localize('scm button commit sync tooltip', "Commit & Sync Changes"); break; } default: { title = localize('scm button commit title', "$(check) Commit"); <del> tooltip = this.state.isActionRunning ? </del> <ins> tooltip = this.state.isCommitInProgress ? </ins> localize('scm button committing tooltip', "Committing Changes...") : localize('scm button commit tooltip', "Commit Changes"); break;

}, ] ], <del> enabled: this.state.repositoryHasChanges && !this.state.isActionRunning </del> <ins> enabled: this.state.repositoryHasChanges && !this.state.isCommitInProgress </ins> }; }

const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); const showActionButton = config.get<{ publish: boolean }>('showActionButton', { publish: true }); <del> // Branch does have an upstream or the button is disabled if (this.state.HEAD?.upstream || !showActionButton.publish) { return undefined; } </del> <ins> // Branch does have an upstream, commit is in progress, or the button is disabled if (this.state.HEAD?.upstream || this.state.isCommitInProgress || !showActionButton.publish) { return undefined; } </ins> return { command: { command: 'git.publish', title: localize('scm publish branch action button title', "{0} Publish Branch", '$(cloud-upload)'), <del> tooltip: this.state.isActionRunning ? </del> <ins> tooltip: this.state.isSyncInProgress ? </ins> localize('scm button publish branch running', "Publishing Branch...") : localize('scm button publish branch', "Publish Branch"), arguments: [this.repository.sourceControl], }, <del> enabled: !this.state.isActionRunning </del> <ins> enabled: !this.state.isSyncInProgress </ins> }; }

const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); const showActionButton = config.get<{ sync: boolean }>('showActionButton', { sync: true }); <del> // Branch does not have an upstream or the button is disabled if (!this.state.HEAD?.upstream || !showActionButton.sync) { return undefined; } </del> <ins> // Branch does not have an upstream, commit is in progress, or the button is disabled if (!this.state.HEAD?.upstream || this.state.isCommitInProgress || !showActionButton.sync) { return undefined; } </ins> const ahead = this.state.HEAD.ahead ? ` ${this.state.HEAD.ahead}$(arrow-up)` : ''; const behind = this.state.HEAD.behind ? ` ${this.state.HEAD.behind}$(arrow-down)` : ''; <del> const icon = this.state.isActionRunning ? '$(sync~spin)' : '$(sync)'; </del> <ins> const icon = this.state.isSyncInProgress ? '$(sync~spin)' : '$(sync)'; </ins> const rebaseWhenSync = config.get<string>('rebaseWhenSync');

command: { command: rebaseWhenSync ? 'git.syncRebase' : 'git.sync', title: `${icon}${behind}${ahead}`, <del> tooltip: this.state.isActionRunning ? </del> <ins> tooltip: this.state.isSyncInProgress ? </ins> 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), <del> enabled: !this.state.isActionRunning </del> <ins> enabled: !this.state.isSyncInProgress </ins> }; } private onDidChangeOperations(): void { <del> const isActionRunning = </del> <ins> const isCommitInProgress = this.repository.operations.isRunning(Operation.Commit); const isSyncInProgress = </ins> this.repository.operations.isRunning(Operation.Sync) || this.repository.operations.isRunning(Operation.Push) || <del> this.repository.operations.isRunning(Operation.Pull) || this.repository.operations.isRunning(Operation.Commit); </del> <ins> this.repository.operations.isRunning(Operation.Pull); </ins> <del> this.state = { ...this.state, isActionRunning }; </del> <ins> this.state = { ...this.state, isCommitInProgress, isSyncInProgress }; </ins> } private onDidRunGitStatus(): void {