mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Implemented rebase onto
This commit is contained in:
@@ -1608,6 +1608,24 @@ export class Repository {
|
||||
}
|
||||
}
|
||||
|
||||
async rebase(branch: string, options: PullOptions = {}): Promise<void> {
|
||||
const args = ['rebase'];
|
||||
|
||||
args.push(branch);
|
||||
|
||||
try {
|
||||
await this.run(args, options);
|
||||
} catch (err) {
|
||||
if (/^CONFLICT \([^)]+\): \b/m.test(err.stdout || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.Conflict;
|
||||
} else if (/cannot rebase onto multiple branches/i.test(err.stderr || '')) {
|
||||
err.gitErrorCode = GitErrorCodes.CantRebaseMultipleBranches;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async push(remote?: string, name?: string, setUpstream: boolean = false, tags = false, forcePushMode?: ForcePushMode): Promise<void> {
|
||||
const args = ['push'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user