Skip to content

Commit ee8a6bc

Browse files
authored
Git: Add "git rebase --abort" command (microsoft#97071)
Add "git rebase --abort" command
1 parent ff89029 commit ee8a6bc

5 files changed

Lines changed: 19 additions & 0 deletions

File tree

extensions/git/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@
409409
"command": "git.timeline.copyCommitMessage",
410410
"title": "%command.timelineCopyCommitMessage%",
411411
"category": "Git"
412+
},
413+
{
414+
"command": "git.rebaseAbort",
415+
"title": "%command.rebaseAbort%",
416+
"category": "Git"
412417
}
413418
],
414419
"keybindings": [

extensions/git/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"command.showOutput": "Show Git Output",
6464
"command.ignore": "Add to .gitignore",
6565
"command.revealInExplorer": "Reveal in Side Bar",
66+
"command.rebaseAbort": "Abort Rebase",
6667
"command.stashIncludeUntracked": "Stash (Include Untracked)",
6768
"command.stash": "Stash",
6869
"command.stashPop": "Pop Stash...",

extensions/git/src/commands.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,6 +2494,10 @@ export class CommandCenter {
24942494
env.clipboard.writeText(item.message);
24952495
}
24962496

2497+
@command('git.rebaseAbort', { repository: true })
2498+
async rebaseAbort(repository: Repository): Promise<void> {
2499+
await repository.rebaseAbort();
2500+
}
24972501

24982502
private createCommand(id: string, key: string, method: Function, options: CommandOptions): (...args: any[]) => any {
24992503
const result = (...args: any[]) => {

extensions/git/src/git.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,10 @@ export class Repository {
13331333
}
13341334
}
13351335

1336+
async rebaseAbort(): Promise<void> {
1337+
await this.run(['rebase', '--abort']);
1338+
}
1339+
13361340
async rebaseContinue(): Promise<void> {
13371341
const args = ['rebase', '--continue'];
13381342

extensions/git/src/repository.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ export const enum Operation {
303303
CheckIgnore = 'CheckIgnore',
304304
GetObjectDetails = 'GetObjectDetails',
305305
SubmoduleUpdate = 'SubmoduleUpdate',
306+
RebaseAbort = 'RebaseAbort',
306307
RebaseContinue = 'RebaseContinue',
307308
FindTrackingBranches = 'GetTracking',
308309
Apply = 'Apply',
@@ -1331,6 +1332,10 @@ export class Repository implements Disposable {
13311332
});
13321333
}
13331334

1335+
async rebaseAbort(): Promise<void> {
1336+
await this.run(Operation.RebaseAbort, async () => await this.repository.rebaseAbort());
1337+
}
1338+
13341339
checkIgnore(filePaths: string[]): Promise<Set<string>> {
13351340
return this.run(Operation.CheckIgnore, () => {
13361341
return new Promise<Set<string>>((resolve, reject) => {

0 commit comments

Comments
 (0)