From 981d446cb0ea84dd6f7a324807bcef6b95a0aee4 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Wed, 7 Jun 2017 14:39:17 +0200
Subject: [PATCH] Update base SHA after merge PR (#277)

---
 lib/api/github.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/api/github.js b/lib/api/github.js
index ed1a9efba1..71b50165ff 100644
--- a/lib/api/github.js
+++ b/lib/api/github.js
@@ -148,7 +148,6 @@ async function initRepo(repoName, token, endpoint) {
     }
     logger.debug(`${repoName} default branch = ${config.defaultBranch}`);
     config.baseCommitSHA = await getBranchCommit(config.defaultBranch);
-    config.baseTreeSHA = await getCommitTree(config.baseCommitSHA);
   } catch (err) /* istanbul ignore next */ {
     logger.error(`GitHub init error: ${JSON.stringify(err)}`);
     throw err;
@@ -410,6 +409,8 @@ async function mergePr(pr) {
       }
     }
   }
+  // Update base branch SHA
+  config.baseCommitSHA = await getBranchCommit(config.defaultBranch);
   // Delete branch
   await deleteBranch(pr.head.ref);
 }
-- 
GitLab