mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Git - fix edge case during rebase (#156410)
Fix blocking issue while resolving conflicts during rebase
This commit is contained in:
@@ -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<string>('postCommitCommand');
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user