From e210bbfea4a2ccf7dc3334df162084f379a9ac48 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:03:47 +0200 Subject: [PATCH] Git - fix edge case during rebase (#156410) Fix blocking issue while resolving conflicts during rebase --- extensions/git/src/actionButton.ts | 19 ++++++++++++------- extensions/git/src/commands.ts | 2 ++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/extensions/git/src/actionButton.ts b/extensions/git/src/actionButton.ts index 527b5b1476c..ba11df7a2aa 100644 --- a/extensions/git/src/actionButton.ts +++ b/extensions/git/src/actionButton.ts @@ -95,21 +95,26 @@ export class ActionButtonCommand { return { command: this.getCommitActionButtonPrimaryCommand(), secondaryCommands: this.getCommitActionButtonSecondaryCommands(), - enabled: this.state.repositoryHasChangesToCommit && !this.state.isCommitInProgress && !this.state.isMergeInProgress + enabled: (this.state.repositoryHasChangesToCommit || this.state.isRebaseInProgress) && !this.state.isCommitInProgress && !this.state.isMergeInProgress }; } private getCommitActionButtonPrimaryCommand(): Command { + // Rebase Continue + if (this.state.isRebaseInProgress) { + return { + command: 'git.commit', + title: localize('scm button continue title', "{0} Continue", '$(check)'), + tooltip: this.state.isCommitInProgress ? localize('scm button continuing tooltip', "Continuing Rebase...") : localize('scm button continue tooltip', "Continue Rebase"), + arguments: [this.repository.sourceControl, ''] + }; + } + + // Commit let commandArg = ''; let title = localize('scm button commit title', "{0} Commit", '$(check)'); let tooltip = this.state.isCommitInProgress ? localize('scm button committing tooltip', "Committing Changes...") : localize('scm button commit tooltip', "Commit Changes"); - // Rebase Continue - if (this.state.isRebaseInProgress) { - return { command: 'git.commit', title, tooltip, arguments: [this.repository.sourceControl, commandArg] }; - } - - // Commit const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); const postCommitCommand = config.get('postCommitCommand'); diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index ac763f00c53..66032dc217c 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1558,6 +1558,8 @@ export class CommandCenter { // amend allows changing only the commit message && !opts.amend && !opts.empty + // rebase not in progress + && repository.rebaseCommit === undefined ) { const commitAnyway = localize('commit anyway', "Create Empty Commit"); const answer = await window.showInformationMessage(localize('no changes', "There are no changes to commit."), commitAnyway);