From bc6d74e0dee06d5e1cc6fc7bebcd4e0cfca5aff3 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Wed, 24 Jan 2018 19:18:03 +0100
Subject: [PATCH] refactor: move github init deletions later

---
 lib/platform/github/index.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js
index 49e52a6c36..94a3ad10f1 100644
--- a/lib/platform/github/index.js
+++ b/lib/platform/github/index.js
@@ -85,10 +85,6 @@ async function initRepo(repoName, token, endpoint, forkMode, forkToken) {
   logger.debug('Resetting platform config');
   // config is used by the platform api itself, not necessary for the app layer to know
   config = {};
-  // This shouldn't be necessary, but occasional strange errors happened until it was added
-  delete config.issueList;
-  delete config.prList;
-  delete config.fileList;
   get.reset();
   config.repoName = repoName;
   // platformConfig is passed back to the app layer and contains info about the platform they require
@@ -130,6 +126,10 @@ async function initRepo(repoName, token, endpoint, forkMode, forkToken) {
     logger.info({ err, res }, 'Unknown GitHub initRepo error');
     throw err;
   }
+  // This shouldn't be necessary, but occasional strange errors happened until it was added
+  delete config.issueList;
+  delete config.prList;
+  delete config.fileList;
   logger.debug('Prefetching prList and fileList');
   await Promise.all([getPrList(), getFileList()]);
   if (forkMode) {
-- 
GitLab