Abort rebase command polish (#108919)

* Abort rebase command polish
This commit is contained in:
Ladislau Szomoru
2020-10-19 10:59:36 +02:00
committed by GitHub
parent cd2a92ae13
commit e1692b33b1
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -623,6 +623,10 @@
"command": "git.commitAllAmend",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
},
{
"command": "git.rebaseAbort",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && gitRebaseInProgress"
},
{
"command": "git.commitNoVerify",
"when": "config.git.enabled && !git.missing && config.git.allowNoVerifyCommit && gitOpenRepositoryCount != 0"
+5 -1
View File
@@ -2498,7 +2498,11 @@ export class CommandCenter {
@command('git.rebaseAbort', { repository: true })
async rebaseAbort(repository: Repository): Promise<void> {
await repository.rebaseAbort();
if (repository.rebaseCommit) {
await repository.rebaseAbort();
} else {
await window.showInformationMessage(localize('no rebase', "No rebase in progress."));
}
}
private createCommand(id: string, key: string, method: Function, options: CommandOptions): (...args: any[]) => any {
+2 -1
View File
@@ -5,7 +5,7 @@
import * as fs from 'fs';
import * as path from 'path';
import { CancellationToken, Command, Disposable, Event, EventEmitter, Memento, OutputChannel, ProgressLocation, ProgressOptions, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, ThemeColor, Uri, window, workspace, WorkspaceEdit, FileDecoration } from 'vscode';
import { CancellationToken, Command, Disposable, Event, EventEmitter, Memento, OutputChannel, ProgressLocation, ProgressOptions, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, ThemeColor, Uri, window, workspace, WorkspaceEdit, FileDecoration, commands } from 'vscode';
import * as nls from 'vscode-nls';
import { Branch, Change, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status, CommitOptions, BranchQuery } from './api/git';
import { AutoFetcher } from './autofetch';
@@ -642,6 +642,7 @@ export class Repository implements Disposable {
}
this._rebaseCommit = rebaseCommit;
commands.executeCommand('setContext', 'gitRebaseInProgress', !!this._rebaseCommit);
}
get rebaseCommit(): Commit | undefined {