Fix microsoft/vscode-pull-request-github#612. Allow fetching with limited depths

This commit is contained in:
Peng Lyu
2018-12-28 12:02:28 -08:00
parent c55cf4b241
commit 94a04621dd
4 changed files with 10 additions and 7 deletions

View File

@@ -1166,7 +1166,7 @@ export class Repository {
await this.run(args);
}
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean } = {}): Promise<void> {
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number } = {}): Promise<void> {
const args = ['fetch'];
if (options.remote) {
@@ -1183,6 +1183,9 @@ export class Repository {
args.push('--prune');
}
if (options.depth) {
args.push(`--depth=${options.depth}`);
}
try {
await this.run(args);
@@ -1198,7 +1201,7 @@ export class Repository {
}
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
const args = ['pull', '--tags'];
const args = ['pull', '--tags', '--unshallow'];
if (rebase) {
args.push('-r');