mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
Removing base scanner (#477)
This commit is contained in:
1 parent
7db08bfd90
commit
65a91ae976
8 files changed
+86
-78
No files matched your search
+11
-8
@@ -4,6 +4,9 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v7/config"
|
||||
"github.com/zricethezav/gitleaks/v7/options"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
)
|
||||
@@ -13,22 +16,22 @@ import (
|
||||
// files available at a commit's worktree and scans the entire content of said files.
|
||||
// Apologies for the awful struct name...
|
||||
type FilesAtCommitScanner struct {
|
||||
BaseScanner
|
||||
|
||||
opts options.Options
|
||||
cfg config.Config
|
||||
repo *git.Repository
|
||||
commit *object.Commit
|
||||
repoName string
|
||||
}
|
||||
|
||||
// NewFilesAtCommitScanner creates and returns a files at commit scanner
|
||||
func NewFilesAtCommitScanner(base BaseScanner, repo *git.Repository, commit *object.Commit) *FilesAtCommitScanner {
|
||||
func NewFilesAtCommitScanner(opts options.Options, cfg config.Config, repo *git.Repository, commit *object.Commit) *FilesAtCommitScanner {
|
||||
fs := &FilesAtCommitScanner{
|
||||
BaseScanner: base,
|
||||
repo: repo,
|
||||
commit: commit,
|
||||
repoName: getRepoName(base.opts),
|
||||
opts: opts,
|
||||
cfg: cfg,
|
||||
repo: repo,
|
||||
commit: commit,
|
||||
repoName: getRepoName(opts),
|
||||
}
|
||||
fs.scannerType = typeFilesAtCommitScanner
|
||||
return fs
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user