提交 bba335ab 编写于 作者: J Joao Moreno

Merge commit 'refs/pull/65786/head' of github.com:Microsoft/vscode into pr/65786

......@@ -168,8 +168,8 @@ export class ApiRepository implements Repository {
return this._repository.removeRemote(name);
}
fetch(remote?: string | undefined, ref?: string | undefined): Promise<void> {
return this._repository.fetch(remote, ref);
fetch(remote?: string | undefined, ref?: string | undefined, depth?: number | undefined): Promise<void> {
return this._repository.fetch(remote, ref, depth);
}
pull(): Promise<void> {
......
......@@ -153,7 +153,7 @@ export interface Repository {
addRemote(name: string, url: string): Promise<void>;
removeRemote(name: string): Promise<void>;
fetch(remote?: string, ref?: string): Promise<void>;
fetch(remote?: string, ref?: string, depth?: number): Promise<void>;
pull(): Promise<void>;
push(remoteName?: string, branchName?: string, setUpstream?: boolean): Promise<void>;
}
......
......@@ -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');
......
......@@ -933,8 +933,8 @@ export class Repository implements Disposable {
await this.run(Operation.Fetch, () => this.repository.fetch({ all: true }));
}
async fetch(remote?: string, ref?: string): Promise<void> {
await this.run(Operation.Fetch, () => this.repository.fetch({ remote, ref }));
async fetch(remote?: string, ref?: string, depth?: number): Promise<void> {
await this.run(Operation.Fetch, () => this.repository.fetch({ remote, ref, depth }));
}
@throttle
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册