diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index b35c1f6e488796f0822eb11aa0da31caed949f83..171132fb6714300cf7a3be058ff21ccb7c86aa55 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()
-  );
 }
 
 /*