From 870194be13fcbff535d02cd760cbdc1a76f199c9 Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Sat, 23 Dec 2023 15:52:41 -0600 Subject: [PATCH] fix errors when using protect and an external git diff tool (#1318) --- sources/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/git.go b/sources/git.go index 9d1c0bb9..94d5c71b 100644 --- a/sources/git.go +++ b/sources/git.go @@ -86,9 +86,9 @@ func NewGitLogCmd(source string, logOpts string) (*GitCmd, error) { func NewGitDiffCmd(source string, staged bool) (*GitCmd, error) { sourceClean := filepath.Clean(source) var cmd *exec.Cmd - cmd = exec.Command("git", "-C", sourceClean, "diff", "-U0", ".") + cmd = exec.Command("git", "-C", sourceClean, "diff", "-U0", "--no-ext-diff", ".") if staged { - cmd = exec.Command("git", "-C", sourceClean, "diff", "-U0", + cmd = exec.Command("git", "-C", sourceClean, "diff", "-U0", "--no-ext-diff", "--staged", ".") } log.Debug().Msgf("executing: %s", cmd.String())