mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
lil hack to avoid scans 'finishing' when git errors are present (#726)
This commit is contained in:
1 parent
6517900e5a
commit
9ae1def963
1 file changed
+3
@@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gitleaks/go-gitdiff/gitdiff"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -39,6 +40,7 @@ func GitLog(source string, logOpts string) (<-chan *gitdiff.File, error) {
|
||||
}
|
||||
|
||||
go listenForStdErr(stderr)
|
||||
time.Sleep(50 * time.Millisecond) // HACK: to avoid https://github.com/zricethezav/gitleaks/issues/722
|
||||
|
||||
return gitdiff.Parse(stdout)
|
||||
}
|
||||
@@ -66,6 +68,7 @@ func GitDiff(source string, staged bool) (<-chan *gitdiff.File, error) {
|
||||
}
|
||||
|
||||
go listenForStdErr(stderr)
|
||||
time.Sleep(50 * time.Millisecond) // HACK: to avoid https://github.com/zricethezav/gitleaks/issues/722
|
||||
|
||||
return gitdiff.Parse(stdout)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user