MCPcopy
hub / github.com/akuity/kargo / MatchesPaths

Method MatchesPaths

pkg/controller/git/commit/base_selector.go:61–80  ·  view source on GitHub ↗

MatchesPaths implements Selector.

(paths []string)

Source from the content-addressed store, hash-verified

59
60// MatchesPaths implements Selector.
61func (b *baseSelector) MatchesPaths(paths []string) bool {
62 for _, path := range paths {
63 // If include is nil, all paths are implicitly included
64 // Otherwise, check if the path matches the include pattern
65 if b.includePaths != nil && !b.includePaths.Matches(path) {
66 // Path not included, skip to next path
67 continue
68 }
69 // Path is included (either implicitly or explicitly)
70 // Now check if it should be excluded
71 if b.excludePaths != nil && b.excludePaths.Matches(path) {
72 // Path is explicitly excluded, skip to next path
73 continue
74 }
75 // If we reach here, the path is included and not excluded
76 return true
77 }
78 // None of the paths match our criteria
79 return false
80}
81
82// getLoggerContext returns key/value pairs that can be used by any selector to
83// enrich loggers with valuable context.

Callers 1

Calls 1

MatchesMethod · 0.65

Tested by 1