From d11cb57f05c7621da6d1fe1aab32d24bc513c454 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 22 May 2019 00:16:47 -0400 Subject: [PATCH] Changes pull to fetch if no tracking branch --- src/git/models/repository.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index 3c97e30..679262c 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -340,7 +340,13 @@ export class Repository implements Disposable { } private async pullCore() { - void (await commands.executeCommand('git.pull', this.path)); + const tracking = await this.hasTrackingBranch(); + if (tracking) { + void (await commands.executeCommand('git.pull', this.path)); + } + else if (configuration.getAny('git.fetchOnPull', Uri.file(this.path))) { + void (await Container.git.fetch(this.path)); + } this.fireChange(RepositoryChange.Repository); }