Merge branch 'bc/Feature26738' of https://github.com/BugraC/vscode into BugraC-bc/Feature26738

This commit is contained in:
Joao Moreno
2017-06-26 15:34:26 +02:00
5 changed files with 62 additions and 6 deletions

View File

@@ -270,7 +270,8 @@ export const GitErrorCodes = {
CantAccessRemote: 'CantAccessRemote',
RepositoryNotFound: 'RepositoryNotFound',
RepositoryIsLocked: 'RepositoryIsLocked',
BranchNotFullyMerged: 'BranchNotFullyMerged'
BranchNotFullyMerged: 'BranchNotFullyMerged',
NoRemoteReference: 'NoRemoteReference'
};
function getGitErrorCode(stderr: string): string | undefined {
@@ -290,6 +291,8 @@ function getGitErrorCode(stderr: string): string | undefined {
return GitErrorCodes.CantAccessRemote;
} else if (/branch '.+' is not fully merged/.test(stderr)) {
return GitErrorCodes.BranchNotFullyMerged;
} else if (/Couldn\'t find remote ref/.test(stderr)) {
return GitErrorCodes.NoRemoteReference;
}
return void 0;
@@ -748,13 +751,21 @@ export class Repository {
}
}
async pull(rebase?: boolean): Promise<void> {
async pull(rebase?: boolean, remote?: string, name?: string): Promise<void> {
const args = ['pull'];
if (rebase) {
args.push('-r');
}
if (remote) {
args.push(remote);
}
if (name) {
args.push(name);
}
try {
await this.run(args);
} catch (err) {