Sfoglia il codice sorgente

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

Zachary Rice 2 anni fa
parent
commit
870194be13
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      sources/git.go

+ 2 - 2
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())