Git: Add "git rebase --abort" command (#97071)
Add "git rebase --abort" command
This commit is contained in:
parent
ff8902990d
commit
ee8a6bc4f8
|
@ -409,6 +409,11 @@
|
||||||
"command": "git.timeline.copyCommitMessage",
|
"command": "git.timeline.copyCommitMessage",
|
||||||
"title": "%command.timelineCopyCommitMessage%",
|
"title": "%command.timelineCopyCommitMessage%",
|
||||||
"category": "Git"
|
"category": "Git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "git.rebaseAbort",
|
||||||
|
"title": "%command.rebaseAbort%",
|
||||||
|
"category": "Git"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"keybindings": [
|
"keybindings": [
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
"command.showOutput": "Show Git Output",
|
"command.showOutput": "Show Git Output",
|
||||||
"command.ignore": "Add to .gitignore",
|
"command.ignore": "Add to .gitignore",
|
||||||
"command.revealInExplorer": "Reveal in Side Bar",
|
"command.revealInExplorer": "Reveal in Side Bar",
|
||||||
|
"command.rebaseAbort": "Abort Rebase",
|
||||||
"command.stashIncludeUntracked": "Stash (Include Untracked)",
|
"command.stashIncludeUntracked": "Stash (Include Untracked)",
|
||||||
"command.stash": "Stash",
|
"command.stash": "Stash",
|
||||||
"command.stashPop": "Pop Stash...",
|
"command.stashPop": "Pop Stash...",
|
||||||
|
|
|
@ -2494,6 +2494,10 @@ export class CommandCenter {
|
||||||
env.clipboard.writeText(item.message);
|
env.clipboard.writeText(item.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@command('git.rebaseAbort', { repository: true })
|
||||||
|
async rebaseAbort(repository: Repository): Promise<void> {
|
||||||
|
await repository.rebaseAbort();
|
||||||
|
}
|
||||||
|
|
||||||
private createCommand(id: string, key: string, method: Function, options: CommandOptions): (...args: any[]) => any {
|
private createCommand(id: string, key: string, method: Function, options: CommandOptions): (...args: any[]) => any {
|
||||||
const result = (...args: any[]) => {
|
const result = (...args: any[]) => {
|
||||||
|
|
|
@ -1333,6 +1333,10 @@ export class Repository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async rebaseAbort(): Promise<void> {
|
||||||
|
await this.run(['rebase', '--abort']);
|
||||||
|
}
|
||||||
|
|
||||||
async rebaseContinue(): Promise<void> {
|
async rebaseContinue(): Promise<void> {
|
||||||
const args = ['rebase', '--continue'];
|
const args = ['rebase', '--continue'];
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,7 @@ export const enum Operation {
|
||||||
CheckIgnore = 'CheckIgnore',
|
CheckIgnore = 'CheckIgnore',
|
||||||
GetObjectDetails = 'GetObjectDetails',
|
GetObjectDetails = 'GetObjectDetails',
|
||||||
SubmoduleUpdate = 'SubmoduleUpdate',
|
SubmoduleUpdate = 'SubmoduleUpdate',
|
||||||
|
RebaseAbort = 'RebaseAbort',
|
||||||
RebaseContinue = 'RebaseContinue',
|
RebaseContinue = 'RebaseContinue',
|
||||||
FindTrackingBranches = 'GetTracking',
|
FindTrackingBranches = 'GetTracking',
|
||||||
Apply = 'Apply',
|
Apply = 'Apply',
|
||||||
|
@ -1331,6 +1332,10 @@ export class Repository implements Disposable {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async rebaseAbort(): Promise<void> {
|
||||||
|
await this.run(Operation.RebaseAbort, async () => await this.repository.rebaseAbort());
|
||||||
|
}
|
||||||
|
|
||||||
checkIgnore(filePaths: string[]): Promise<Set<string>> {
|
checkIgnore(filePaths: string[]): Promise<Set<string>> {
|
||||||
return this.run(Operation.CheckIgnore, () => {
|
return this.run(Operation.CheckIgnore, () => {
|
||||||
return new Promise<Set<string>>((resolve, reject) => {
|
return new Promise<Set<string>>((resolve, reject) => {
|
||||||
|
|
Loading…
Reference in a new issue