From f5291475e49db44ce8cc056793312f1807a865ac Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Sat, 15 Jul 2023 03:00:26 -0300 Subject: [PATCH] fix: ensure git.hasDiff will not compare against files (#23376) --- lib/util/git/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 16b22575ab43c9..81811c059decab 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -897,7 +897,9 @@ export async function hasDiff( ): Promise { await syncGit(); try { - return (await gitRetry(() => git.diff([sourceRef, targetRef]))) !== ''; + return ( + (await gitRetry(() => git.diff([sourceRef, targetRef, '--']))) !== '' + ); } catch (err) { return true; }