From 43d71535b2e0bcb936a26f76651143a3338d7e03 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Mon, 12 Oct 2020 13:48:04 +0200
Subject: [PATCH] fix(git): robust git diff for getBranchFiles

Closes #7454
---
 lib/util/git/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index 30d54fe518..f751b8a773 100644
--- a/lib/util/git/index.ts
+++ b/lib/util/git/index.ts
@@ -500,7 +500,7 @@ export async function getBranchLastCommitTime(
 export async function getBranchFiles(branchName: string): Promise<string[]> {
   await syncBranch(branchName);
   try {
-    const diff = await git.diffSummary([branchName, config.currentBranch]);
+    const diff = await git.diffSummary([`${branchName}^`]);
     return diff.files.map((file) => file.file);
   } catch (err) /* istanbul ignore next */ {
     logger.warn({ err }, 'getBranchFiles error');
-- 
GitLab