diff --git a/src/constants.ts b/src/constants.ts index cd2274f256c78..f88cee6922517 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -354,6 +354,8 @@ export const enum CoreGitCommands { PushForce = 'git.pushForce', UndoCommit = 'git.undoCommit', Fetch = 'git.fetch', + FetchAll = 'git.fetchAll', + FetchPrune = 'git.fetchPrune', } export const enum CoreGitConfiguration { diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index c205ffccbee12..5eb5a40122c2c 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -577,10 +577,17 @@ export class Repository implements Disposable { remote?: string; }) { try { - if (options?.branch != null) { + if (options?.branch != null || options?.remote) { await this.container.git.fetch(this.path, options); } else { - void (await executeCoreGitCommand(CoreGitCommands.Fetch, this.path)); + void (await executeCoreGitCommand( + options?.prune + ? CoreGitCommands.FetchPrune + : options?.all + ? CoreGitCommands.FetchAll + : CoreGitCommands.Fetch, + this.path, + )); } this.fireChange(RepositoryChange.Unknown);