From 72781b1ee368167c56a1872d0124f27ac6d69bb7 Mon Sep 17 00:00:00 2001 From: Lode Claassen <lode@alsvanzelf.nl> Date: Thu, 18 Aug 2022 15:04:05 +0200 Subject: [PATCH] fixes #1302 danger local to play nice with git config diff.noprefix --- source/platforms/git/localGetDiff.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/platforms/git/localGetDiff.ts b/source/platforms/git/localGetDiff.ts index bdff4e98b..13da3a2f8 100644 --- a/source/platforms/git/localGetDiff.ts +++ b/source/platforms/git/localGetDiff.ts @@ -2,8 +2,8 @@ import { debug } from "../../debug" import { spawn } from "child_process" const d = debug("localGetDiff") -const useCommittedDiffArgs = (base: string, head: string) => ["diff", `${base}...${head}`] -const useStagingChanges = (base: string) => ["diff", base] +const useCommittedDiffArgs = (base: string, head: string) => ["diff", "--src-prefix='a/' --dst-prefix='b/'", `${base}...${head}`] +const useStagingChanges = (base: string) => ["diff", "--src-prefix='a/' --dst-prefix='b/'", base] export const localGetDiff = (base: string, head: string, staging: boolean = false) => new Promise<string>(done => { const args = staging ? useStagingChanges(base) : useCommittedDiffArgs(base, head)