Add "pullFrom" git command

Resolves Microsoft/vscode#26738
This commit is contained in:
Matt Shirley
2017-05-20 00:10:04 -07:00
parent 4ba9130583
commit 42ab4c41a4
5 changed files with 51 additions and 4 deletions

View File

@@ -291,6 +291,8 @@ function getGitErrorCode(stderr: string): string | undefined {
return GitErrorCodes.RepositoryNotFound;
} else if (/unable to access/.test(stderr)) {
return GitErrorCodes.CantAccessRemote;
} else if (/Couldn\'t find remote ref/.test(stderr)) {
return GitErrorCodes.CantAccessRemote;
}
return void 0;
@@ -730,13 +732,18 @@ export class Repository {
}
}
async pull(rebase?: boolean): Promise<void> {
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
const args = ['pull'];
if (rebase) {
args.push('-r');
}
if (remote && branch) {
args.push(remote);
args.push(branch);
}
try {
await this.run(args);
} catch (err) {