mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
git.pruneOnFetch setting implemented
This commit is contained in:
@@ -1072,21 +1072,34 @@ export class Repository implements Disposable {
|
||||
|
||||
@throttle
|
||||
async fetchDefault(options: { silent?: boolean } = {}): Promise<void> {
|
||||
await this.run(Operation.Fetch, () => this.repository.fetch(options));
|
||||
await this.fetchFrom({ silent: options.silent });
|
||||
}
|
||||
|
||||
@throttle
|
||||
async fetchPrune(): Promise<void> {
|
||||
await this.run(Operation.Fetch, () => this.repository.fetch({ prune: true }));
|
||||
await this.fetchFrom({ prune: true });
|
||||
}
|
||||
|
||||
@throttle
|
||||
async fetchAll(): Promise<void> {
|
||||
await this.run(Operation.Fetch, () => this.repository.fetch({ all: true }));
|
||||
await this.fetchFrom({ all: true });
|
||||
}
|
||||
|
||||
async fetch(remote?: string, ref?: string, depth?: number): Promise<void> {
|
||||
await this.run(Operation.Fetch, () => this.repository.fetch({ remote, ref, depth }));
|
||||
await this.fetchFrom({ remote, ref, depth });
|
||||
}
|
||||
|
||||
private async fetchFrom(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean } = {}): Promise<void> {
|
||||
await this.run(Operation.Fetch, async () => {
|
||||
const config = workspace.getConfiguration('git', Uri.file(this.root));
|
||||
const prune = config.get<boolean>('pruneOnFetch');
|
||||
|
||||
if (prune) {
|
||||
options.prune = prune;
|
||||
}
|
||||
|
||||
this.repository.fetch(options);
|
||||
});
|
||||
}
|
||||
|
||||
@throttle
|
||||
|
||||
Reference in New Issue
Block a user