fix errors when using protect and an external git diff tool (#1318)

This commit is contained in:
Zachary Rice authored and GitHub committed 2023-12-23 15:52:41 -06:00
1 parent 179c607541
commit 870194be13
1 file changed
+2 -2
+2 -2
View File
@@ -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())