Skip to content

Find, verify, and analyze leaked credentials

Initialize scan options if given a nil pointer (#924)

Miccah86f9e1288f34
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index 4646a0472..2096a2db4 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -540,6 +540,9 @@ func (s *Git) ScanUnstaged(ctx context.Context, repo *git.Repository, path strin
}
func (s *Git) ScanRepo(ctx context.Context, repo *git.Repository, repoPath string, scanOptions *ScanOptions, chunksChan chan *sources.Chunk) error {
+ if scanOptions == nil {
+ scanOptions = NewScanOptions()
+ }
if err := normalizeConfig(scanOptions, repo); err != nil {
return err
}