add unshallow as an option for git pull

This commit is contained in:
Joao Moreno
2019-01-07 11:22:26 +01:00
parent bba335ab63
commit ff157f90a0
4 changed files with 19 additions and 11 deletions

View File

@@ -629,6 +629,10 @@ export interface CommitOptions {
empty?: boolean;
}
export interface PullOptions {
unshallow?: boolean;
}
export enum ForcePushMode {
Force,
ForceWithLease
@@ -1183,7 +1187,7 @@ export class Repository {
args.push('--prune');
}
if (options.depth) {
if (typeof options.depth === 'number') {
args.push(`--depth=${options.depth}`);
}
@@ -1200,8 +1204,12 @@ export class Repository {
}
}
async pull(rebase?: boolean, remote?: string, branch?: string): Promise<void> {
const args = ['pull', '--tags', '--unshallow'];
async pull(rebase?: boolean, remote?: string, branch?: string, options: PullOptions = {}): Promise<void> {
const args = ['pull', '--tags'];
if (options.unshallow) {
args.push('--unshallow');
}
if (rebase) {
args.push('-r');