Skip to content

Commit 6be5ee1

Browse files
authored
Remove overseer warn, and don't os.Exit on git error. (#348)
1 parent 972108a commit 6be5ee1

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ module github.com/trufflesecurity/trufflehog/v3
22

33
go 1.17
44

5-
replace github.com/jpillora/overseer => github.com/trufflesecurity/overseer v1.1.7-custom3
5+
replace github.com/jpillora/overseer => github.com/trufflesecurity/overseer v1.1.7-custom4
6+
7+
replace github.com/zricethezav/gitleaks/v8 => github.com/trufflesecurity/gitleaks/v8 v8.6.1-custom1
68

79
require (
810
cloud.google.com/go/secretmanager v1.3.0

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
446446
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
447447
github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502 h1:34icjjmqJ2HPjrSuJYEkdZ+0ItmGQAQ75cRHIiftIyE=
448448
github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8=
449-
github.com/trufflesecurity/overseer v1.1.7-custom3 h1:hpSYY+ca0lug3tbpOoEbUxwrdKSDCtwLasoxruKGXPc=
450-
github.com/trufflesecurity/overseer v1.1.7-custom3/go.mod h1:nT9w37AiO1Nop2VhVhNfzAFaPjthvxgpDV3XKsxYkcI=
449+
github.com/trufflesecurity/gitleaks/v8 v8.6.1-custom1 h1:HJPy+ciKU82lFPK0cxXJ4BYvCIANCQp29zhjU2T1UXo=
450+
github.com/trufflesecurity/gitleaks/v8 v8.6.1-custom1/go.mod h1:TxBuxH8eB/1la8Mc7I6j/ZZYNG/mHGpoi09N2oHx5nQ=
451+
github.com/trufflesecurity/overseer v1.1.7-custom4 h1:5ed5+2+N3ZaW7oc4n7PIjkybGHUZmdCH9iAztB/2+Cc=
452+
github.com/trufflesecurity/overseer v1.1.7-custom4/go.mod h1:nT9w37AiO1Nop2VhVhNfzAFaPjthvxgpDV3XKsxYkcI=
451453
github.com/xanzy/go-gitlab v0.60.0 h1:HaIlc14k4t9eJjAhY0Gmq2fBHgKd1MthBn3+vzDtsbA=
452454
github.com/xanzy/go-gitlab v0.60.0/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM=
453455
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
@@ -460,8 +462,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
460462
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
461463
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
462464
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
463-
github.com/zricethezav/gitleaks/v8 v8.5.2 h1:+IiLvmBiMGetpgNtzC71EHktTXc1Zt7m9AwnqhhJ04g=
464-
github.com/zricethezav/gitleaks/v8 v8.5.2/go.mod h1:TxBuxH8eB/1la8Mc7I6j/ZZYNG/mHGpoi09N2oHx5nQ=
465465
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
466466
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
467467
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=

pkg/sources/git/git.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,13 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOp
262262
if err := GitCmdCheck(); err != nil {
263263
return err
264264
}
265-
zerolog.SetGlobalLevel(zerolog.Disabled)
266-
fileChan, err := glgo.GitLog(path, scanOptions.HeadHash)
265+
if log.GetLevel() < log.DebugLevel {
266+
zerolog.SetGlobalLevel(zerolog.Disabled)
267+
}
268+
269+
// Errors returned on errChan aren't blocking, so just ignore them.
270+
errChan := make(chan error)
271+
fileChan, err := glgo.GitLog(path, scanOptions.HeadHash, errChan)
267272
if err != nil {
268273
return errors.WrapPrefix(err, "could not open repo path", 0)
269274
}

0 commit comments

Comments
 (0)