From e10aa6aa5a47056471b1cfa0d58cbc0ba16083e7 Mon Sep 17 00:00:00 2001
From: RahulGautamSingh <rahultesnik@gmail.com>
Date: Mon, 11 Jul 2022 14:28:51 +0530
Subject: [PATCH] fix: check cache before cloning (#16517)

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

diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index a1f8b317fb..3e7a7c2057 100644
--- a/lib/util/git/index.ts
+++ b/lib/util/git/index.ts
@@ -621,8 +621,6 @@ export async function isBranchConflicted(
   branch: string
 ): Promise<boolean> {
   logger.debug(`isBranchConflicted(${baseBranch}, ${branch})`);
-  await syncGit();
-  await writeGitAuthor();
 
   const baseBranchSha = getBranchCommit(baseBranch);
   const branchSha = getBranchCommit(branch);
@@ -648,6 +646,8 @@ export async function isBranchConflicted(
   }
 
   let result = false;
+  await syncGit();
+  await writeGitAuthor();
 
   const origBranch = config.currentBranch;
   try {
-- 
GitLab