@@ -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
@@ -108,7 +108,7 @@ const (
108
108
// - Any lockfiles with scanLockfile
109
109
// - Any SBOM files with scanSBOMFile
110
110
// - Any git repositories with scanGit
111
- func scanDir (r reporter.Reporter , dir string , skipGit bool , recursive bool , useGitIgnore bool , compareOffline bool ) ([]scannedPackage , error ) {
111
+ func scanDir (r reporter.Reporter , dir string , includeGit bool , recursive bool , useGitIgnore bool , compareOffline bool ) ([]scannedPackage , error ) {
112
112
var ignoreMatcher * gitIgnoreMatcher
113
113
if useGitIgnore {
114
114
var err error
@@ -152,7 +152,7 @@ func scanDir(r reporter.Reporter, dir string, skipGit bool, recursive bool, useG
152
152
}
153
153
}
154
154
155
- if ! skipGit && info .IsDir () && info .Name () == ".git" {
155
+ if includeGit && info .IsDir () && info .Name () == ".git" {
156
156
pkgs , err := scanGit (r , filepath .Dir (path )+ "/" )
157
157
if err != nil {
158
158
r .Infof ("scan failed for git repository, %s: %v\n " , path , err )
@@ -828,7 +828,7 @@ func DoScan(actions ScannerActions, r reporter.Reporter) (models.VulnerabilityRe
828
828
}
829
829
830
830
if actions .CompareOffline {
831
- actions .SkipGit = true
831
+ actions .IncludeGit = false
832
832
833
833
if len (actions .ScanLicensesAllowlist ) > 0 || actions .ScanLicensesSummary {
834
834
return models.VulnerabilityResults {}, errors .New ("cannot retrieve licenses locally" )
@@ -903,7 +903,7 @@ func DoScan(actions ScannerActions, r reporter.Reporter) (models.VulnerabilityRe
903
903
904
904
for _ , dir := range actions .DirectoryPaths {
905
905
r .Infof ("Scanning dir %s\n " , dir )
906
- pkgs , err := scanDir (r , dir , actions .SkipGit , actions .Recursive , ! actions .NoIgnore , actions .CompareOffline )
906
+ pkgs , err := scanDir (r , dir , actions .IncludeGit , actions .Recursive , ! actions .NoIgnore , actions .CompareOffline )
907
907
if err != nil {
908
908
return models.VulnerabilityResults {}, err
909
909
}
0 commit comments