From 7324e4cdd96f0630a2e5ae86168bd28375906e55 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 17 May 2019 16:59:48 +0200
Subject: [PATCH] fix(gitFs): better branch fetch

---
 lib/platform/git/storage.ts | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/platform/git/storage.ts b/lib/platform/git/storage.ts
index 3d249dcbc0..09b0d0a2a6 100644
--- a/lib/platform/git/storage.ts
+++ b/lib/platform/git/storage.ts
@@ -250,14 +250,8 @@ class Storage {
     if (!branchName.startsWith(this._config.branchPrefix)) {
       // fetch the branch only if it's not part of the existing branchPrefix
       try {
-        await this._git!.raw([
-          'remote',
-          'set-branches',
-          '--add',
-          'origin',
-          branchName,
-        ]);
-        await this._git!.fetch(['origin', branchName, '--depth=2']);
+        const ref = `refs/heads/${branchName}:refs/remotes/origin/${branchName}`;
+        await this._git!.fetch(['origin', ref, '--depth=2', '--force']);
       } catch (err) {
         // do nothing
       }
-- 
GitLab