@@ -42,7 +42,7 @@ type ScannerActions struct {
42
42
DirectoryPaths []string
43
43
GitCommits []string
44
44
Recursive bool
45
- SkipGit bool
45
+ IncludeGit bool
46
46
NoIgnore bool
47
47
DockerContainerNames []string
48
48
ConfigOverridePath string
@@ -114,7 +114,7 @@ const (
114
114
// - Any lockfiles with scanLockfile
115
115
// - Any SBOM files with scanSBOMFile
116
116
// - Any git repositories with scanGit
117
- func scanDir (r reporter.Reporter , dir string , skipGit bool , recursive bool , useGitIgnore bool , compareOffline bool , transitiveAct TransitiveScanningActions ) ([]scannedPackage , error ) {
117
+ func scanDir (r reporter.Reporter , dir string , includeGit bool , recursive bool , useGitIgnore bool , compareOffline bool , transitiveAct TransitiveScanningActions ) ([]scannedPackage , error ) {
118
118
var ignoreMatcher * gitIgnoreMatcher
119
119
if useGitIgnore {
120
120
var err error
@@ -158,7 +158,7 @@ func scanDir(r reporter.Reporter, dir string, skipGit bool, recursive bool, useG
158
158
}
159
159
}
160
160
161
- if ! skipGit && info .IsDir () && info .Name () == ".git" {
161
+ if includeGit && info .IsDir () && info .Name () == ".git" {
162
162
pkgs , err := scanGit (r , filepath .Dir (path )+ "/" )
163
163
if err != nil {
164
164
r .Infof ("scan failed for git repository, %s: %v\n " , path , err )
@@ -857,7 +857,7 @@ func DoScan(actions ScannerActions, r reporter.Reporter) (models.VulnerabilityRe
857
857
}
858
858
859
859
if actions .CompareOffline {
860
- actions .SkipGit = true
860
+ actions .IncludeGit = false
861
861
862
862
if len (actions .ScanLicensesAllowlist ) > 0 || actions .ScanLicensesSummary {
863
863
return models.VulnerabilityResults {}, errors .New ("cannot retrieve licenses locally" )
@@ -932,7 +932,7 @@ func DoScan(actions ScannerActions, r reporter.Reporter) (models.VulnerabilityRe
932
932
933
933
for _ , dir := range actions .DirectoryPaths {
934
934
r .Infof ("Scanning dir %s\n " , dir )
935
- pkgs , err := scanDir (r , dir , actions .SkipGit , actions .Recursive , ! actions .NoIgnore , actions .CompareOffline , actions .TransitiveScanningActions )
935
+ pkgs , err := scanDir (r , dir , actions .IncludeGit , actions .Recursive , ! actions .NoIgnore , actions .CompareOffline , actions .TransitiveScanningActions )
936
936
if err != nil {
937
937
return models.VulnerabilityResults {}, err
938
938
}
0 commit comments