mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
fix errors when using protect and an external git diff tool (#1318)
This commit is contained in:
1 parent
179c607541
commit
870194be13
1 file changed
+2
-2
+2
-2
@@ -86,9 +86,9 @@ func NewGitLogCmd(source string, logOpts string) (*GitCmd, error) {
|
|||||||
func NewGitDiffCmd(source string, staged bool) (*GitCmd, error) {
|
func NewGitDiffCmd(source string, staged bool) (*GitCmd, error) {
|
||||||
sourceClean := filepath.Clean(source)
|
sourceClean := filepath.Clean(source)
|
||||||
var cmd *exec.Cmd
|
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 {
|
if staged {
|
||||||
cmd = exec.Command("git", "-C", sourceClean, "diff", "-U0",
|
cmd = exec.Command("git", "-C", sourceClean, "diff", "-U0", "--no-ext-diff",
|
||||||
"--staged", ".")
|
"--staged", ".")
|
||||||
}
|
}
|
||||||
log.Debug().Msgf("executing: %s", cmd.String())
|
log.Debug().Msgf("executing: %s", cmd.String())
|
||||||
|
|||||||
Reference in new issue
Block a user