Skip to content

Commit

Permalink
fix multi-value context
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Dec 10, 2024
1 parent e1bcfca commit 1ac8caa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/agent/cache/exclusions.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ func CompileExcludedPaths() []*regexp.Regexp {

// Compile excluded patterns
for _, pattern := range excludedPatterns {
compiledRegexes = append(compiledRegexes, regexp.MustCompile("(?i)"+utils.GlobToRegex(pattern)))
rexp, err := utils.GlobToRegex(pattern)
if err != nil {
continue
}
compiledRegexes = append(compiledRegexes, regexp.MustCompile("(?i)"+rexp))
}

return compiledRegexes
Expand Down
6 changes: 5 additions & 1 deletion internal/agent/cache/partial_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ func CompilePartialFileList() []*regexp.Regexp {

// Compile excluded patterns
for _, pattern := range partialPatterns {
compiledRegexes = append(compiledRegexes, regexp.MustCompile("(?i)^"+utils.GlobToRegex(pattern)))
rexp, err := utils.GlobToRegex(pattern)
if err != nil {
continue
}
compiledRegexes = append(compiledRegexes, regexp.MustCompile("(?i)"+rexp))
}

return compiledRegexes
Expand Down

0 comments on commit 1ac8caa

Please sign in to comment.