mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Implemented rebase onto
This commit is contained in:
@@ -300,6 +300,7 @@ export const enum Operation {
|
||||
RenameBranch = 'RenameBranch',
|
||||
DeleteRef = 'DeleteRef',
|
||||
Merge = 'Merge',
|
||||
Rebase = 'Rebase',
|
||||
Ignore = 'Ignore',
|
||||
Tag = 'Tag',
|
||||
DeleteTag = 'DeleteTag',
|
||||
@@ -1067,6 +1068,10 @@ export class Repository implements Disposable {
|
||||
await this.run(Operation.Merge, () => this.repository.merge(ref));
|
||||
}
|
||||
|
||||
async rebase(branch: string): Promise<void> {
|
||||
await this.run(Operation.Rebase, () => this.repository.rebase(branch));
|
||||
}
|
||||
|
||||
async tag(name: string, message?: string): Promise<void> {
|
||||
await this.run(Operation.Tag, () => this.repository.tag(name, message));
|
||||
}
|
||||
@@ -1143,6 +1148,14 @@ export class Repository implements Disposable {
|
||||
return this.pullFrom(true, remote, branch);
|
||||
}
|
||||
|
||||
@throttle
|
||||
async rebaseOnto(head: Branch | undefined, branch: Branch | undefined): Promise<void> {
|
||||
if (head?.name && branch?.name) {
|
||||
await this.checkout(branch.name);
|
||||
await this.rebase(head.name);
|
||||
}
|
||||
}
|
||||
|
||||
@throttle
|
||||
async pull(head?: Branch, unshallow?: boolean): Promise<void> {
|
||||
let remote: string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user