From 852b3409263ea3c9cee56f6ddec1c50971642c10 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Wed, 22 Jul 2020 19:41:11 +0200
Subject: [PATCH] refactor: git.setBranch return

---
 lib/util/git/index.ts | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index b35c1f6e48..171132fb67 100644
--- a/lib/util/git/index.ts
+++ b/lib/util/git/index.ts
@@ -321,6 +321,7 @@ export async function setBranch(branchName: string): Promise<string> {
     const latestCommitDate = (await git.log({ n: 1 })).latest.date;
     logger.debug({ branchName, latestCommitDate }, 'latest commit');
     await git.reset(ResetMode.HARD);
+    return config.currentBranchSha;
   } catch (err) /* istanbul ignore next */ {
     checkForPlatformFailure(err);
     if (
@@ -333,10 +334,6 @@ export async function setBranch(branchName: string): Promise<string> {
     }
     throw err;
   }
-  return (
-    config.currentBranchSha ||
-    (await git.raw(['rev-parse', 'origin/master'])).trim()
-  );
 }
 
 /*
-- 
GitLab