From 42becebf2347b22e1acc615ff70a7a9e90f2a175 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sat, 25 May 2019 06:59:46 +0200
Subject: [PATCH] fix: migrate gitFs on CLI and bot config

---
 lib/config/cli.js                             | 22 ++++++++++---------
 lib/config/migration.js                       |  3 +++
 .../__snapshots__/migration.spec.js.snap      |  2 --
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/lib/config/cli.js b/lib/config/cli.js
index 8c22a2c096..44570d4808 100644
--- a/lib/config/cli.js
+++ b/lib/config/cli.js
@@ -17,16 +17,18 @@ function getCliName(option) {
 
 function getConfig(input) {
   // massage migrated configuration keys
-  const argv = input.map(a =>
-    a
-      .replace('--endpoints=', '--host-rules=')
-      .replace('--expose-env=true', '--trust-level=high')
-      .replace('--expose-env', '--trust-level=high')
-      .replace('--renovate-fork', '--include-forks')
-      .replace('"platform":"', '"hostType":"')
-      .replace('"endpoint":"', '"baseUrl":"')
-      .replace('"host":"', '"hostName":"')
-  );
+  const argv = input
+    .map(a =>
+      a
+        .replace('--endpoints=', '--host-rules=')
+        .replace('--expose-env=true', '--trust-level=high')
+        .replace('--expose-env', '--trust-level=high')
+        .replace('--renovate-fork', '--include-forks')
+        .replace('"platform":"', '"hostType":"')
+        .replace('"endpoint":"', '"baseUrl":"')
+        .replace('"host":"', '"hostName":"')
+    )
+    .filter(a => !a.startsWith('--git-fs'));
   const options = configDefinitions.getOptions();
 
   const config = {};
diff --git a/lib/config/migration.js b/lib/config/migration.js
index 223168fefa..868dd85986 100644
--- a/lib/config/migration.js
+++ b/lib/config/migration.js
@@ -121,6 +121,9 @@ function migrateConfig(config, parentKey) {
         } else if (val === false) {
           migratedConfig.rangeStrategy = 'replace';
         }
+      } else if (key === 'gitFs') {
+        isMigrated = true;
+        delete migratedConfig.gitFs;
       } else if (key === 'exposeEnv') {
         isMigrated = true;
         delete migratedConfig.exposeEnv;
diff --git a/test/config/__snapshots__/migration.spec.js.snap b/test/config/__snapshots__/migration.spec.js.snap
index b0134cbafd..0408283bbf 100644
--- a/test/config/__snapshots__/migration.spec.js.snap
+++ b/test/config/__snapshots__/migration.spec.js.snap
@@ -21,7 +21,6 @@ Object {
     "config:js-app",
     "config:js-lib",
   ],
-  "gitFs": false,
   "hostRules": Array [
     Object {},
   ],
@@ -31,7 +30,6 @@ Object {
   "includeForks": true,
   "lockFileMaintenance": Object {
     "automerge": true,
-    "gitFs": true,
     "schedule": "before 5am",
     "trustLevel": "low",
   },
-- 
GitLab