| 1 | package filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/ |
| 2 | |
| 3 | import ( |
| 4 | "stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/" |
| 5 | "syncscip-go gomod github.com/golang/go/src go1.25.0 sync/" |
| 6 | |
| 7 | "github.com/git-lfs/git-lfs/v3/trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/" |
| 8 | "github.com/git-lfs/wildmatch/v2scip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/" |
| 9 | "github.com/golang/groupcache/lruscip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/" |
| 10 | "github.com/rubyist/tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/" |
| 11 | ) |
| 12 | |
| 13 | type Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern# interface { |
| 14 | Matchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#Match.(filename string) bool |
| 15 | // String returns a string representation (see: regular expressions) of |
| 16 | // the underlying pattern used to match filenames against this Pattern. |
| 17 | Stringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#String.() string |
| 18 | } |
| 19 | |
| 20 | type Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter# struct { |
| 21 | includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#include. []Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern# |
| 22 | excludescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#exclude. []Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern# |
| 23 | defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#defaultValue. bool |
| 24 | cachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cache. *lruscip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/.Cachescip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/Cache# |
| 25 | cacheLockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cacheLock. syncscip-go gomod github.com/golang/go/src go1.25.0 sync/.Mutexscip-go gomod github.com/golang/go/src go1.25.0 sync/Mutex# |
| 26 | } |
| 27 | |
| 28 | type PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType# bool |
| 29 | |
| 30 | const ( |
| 31 | GitIgnorescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitIgnore. = PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#(false) |
| 32 | GitAttributesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitAttributes. = PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#(true) |
| 33 | ) |
| 34 | |
| 35 | func (p PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#) Stringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#String().() string { |
| 36 | if p == GitIgnorescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitIgnore. { |
| 37 | return "gitignore" |
| 38 | } |
| 39 | return "gitattributes" |
| 40 | } |
| 41 | |
| 42 | type optionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options# struct { |
| 43 | defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#defaultValue. bool |
| 44 | useCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#useCache. bool |
| 45 | cacheSizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#cacheSize. int |
| 46 | } |
| 47 | |
| 48 | type Optionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Option# func(*optionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#) |
| 49 | |
| 50 | // DefaultValue is an option representing the default value of a filepathfilter |
| 51 | // if no patterns match. If this option is not provided, the default is true. |
| 52 | func DefaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/DefaultValue().(val bool) Optionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Option# { |
| 53 | return func(args *optionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#) { |
| 54 | args.defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#defaultValue. = val |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func EnableCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/EnableCache().(size int) Optionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Option# { |
| 59 | return func(args *optionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#) { |
| 60 | args.useCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#useCache. = true |
| 61 | args.cacheSizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#cacheSize. = size |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func DisableCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/DisableCache().() Optionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Option# { |
| 66 | return func(args *optionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#) { |
| 67 | args.useCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#useCache. = false |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func NewFromPatternsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/NewFromPatterns().(include, exclude []Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#, setters ...Optionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Option#) *Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter# { |
| 72 | args := &optionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#{defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#defaultValue.: true, useCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#useCache.: false} |
| 73 | for _, setter := range setters { |
| 74 | setter(args) |
| 75 | } |
| 76 | |
| 77 | f := &Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#{includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#include.: include, excludescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#exclude.: exclude, defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#defaultValue.: args.defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#defaultValue.} |
| 78 | |
| 79 | if args.useCachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#useCache. && args.cacheSizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#cacheSize. >= 0 { |
| 80 | f.cachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cache. = lruscip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/.Newscip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/New().(args.cacheSizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/options#cacheSize.) |
| 81 | } |
| 82 | |
| 83 | return f |
| 84 | } |
| 85 | |
| 86 | func Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/New().(include, exclude []string, ptype PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#, gitEnv Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#, setters ...Optionscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Option#) *Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter# { |
| 87 | return NewFromPatternsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/NewFromPatterns().( |
| 88 | convertToWildmatchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/convertToWildmatch().(include, ptype, gitEnv), |
| 89 | convertToWildmatchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/convertToWildmatch().(exclude, ptype, gitEnv), setters...) |
| 90 | } |
| 91 | |
| 92 | // Include returns the result of calling String() on each Pattern in the |
| 93 | // include set of this *Filter. |
| 94 | func (f *Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#) Includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#Include().() []string { return wildmatchToStringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wildmatchToString().(f.includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#include....) } |
| 95 | |
| 96 | // Exclude returns the result of calling String() on each Pattern in the |
| 97 | // exclude set of this *Filter. |
| 98 | func (f *Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#) Excludescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#Exclude().() []string { return wildmatchToStringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wildmatchToString().(f.excludescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#exclude....) } |
| 99 | |
| 100 | // wildmatchToString maps the given set of Pattern's to a string slice by |
| 101 | // calling String() on each pattern. |
| 102 | func wildmatchToStringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wildmatchToString().(ps ...Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#) []string { |
| 103 | s := make([]string, 0, len(ps)) |
| 104 | for _, p := range ps { |
| 105 | s = append(s, p.Stringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#String.()) |
| 106 | } |
| 107 | |
| 108 | return s |
| 109 | } |
| 110 | |
| 111 | func (f *Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#) allowsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#allows().(filename string) bool { |
| 112 | var included bool |
| 113 | for _, inc := range f.includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#include. { |
| 114 | if included = inc.Matchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#Match.(filename); included { |
| 115 | break |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | if !included && len(f.includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#include.) > 0 { |
| 120 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("filepathfilter: rejecting %q via %v", filename, f.includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#include.) |
| 121 | return false |
| 122 | } |
| 123 | |
| 124 | // Beyond this point, the only values we can logically return are false |
| 125 | // or the default value. If the default is false, then there's no point |
| 126 | // traversing the exclude patterns because the return value will always |
| 127 | // be false; we'd do extra work for no functional benefit. |
| 128 | if !included && !f.defaultValuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#defaultValue. { |
| 129 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("filepathfilter: rejecting %q", filename) |
| 130 | return false |
| 131 | } |
| 132 | |
| 133 | for _, ex := range f.excludescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#exclude. { |
| 134 | if ex.Matchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#Match.(filename) { |
| 135 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("filepathfilter: rejecting %q via %q", filename, ex.Stringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#String.()) |
| 136 | return false |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | // No patterns matched and our default value is true. |
| 141 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("filepathfilter: accepting %q", filename) |
| 142 | return true |
| 143 | } |
| 144 | |
| 145 | func (f *Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#) Allowsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#Allows().(filename string) bool { |
| 146 | if f == nil { |
| 147 | return true |
| 148 | } |
| 149 | |
| 150 | if f.cachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cache. != nil { |
| 151 | f.cacheLockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cacheLock..Lockscip-go gomod github.com/golang/go/src go1.25.0 sync/Mutex#Lock().() |
| 152 | res, ok := f.cachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cache..Getscip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/Cache#Get().(filename) |
| 153 | f.cacheLockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cacheLock..Unlockscip-go gomod github.com/golang/go/src go1.25.0 sync/Mutex#Unlock().() |
| 154 | if ok { |
| 155 | return res.(bool) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | res := f.allowsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#allows().(filename) |
| 160 | |
| 161 | if f.cachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cache. != nil { |
| 162 | f.cacheLockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cacheLock..Lockscip-go gomod github.com/golang/go/src go1.25.0 sync/Mutex#Lock().() |
| 163 | f.cachescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cache..Addscip-go gomod github.com/golang/groupcache 2c02b8208cf8 `github.com/golang/groupcache/lru`/Cache#Add().(filename, res) |
| 164 | f.cacheLockscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#cacheLock..Unlockscip-go gomod github.com/golang/go/src go1.25.0 sync/Mutex#Unlock().() |
| 165 | } |
| 166 | |
| 167 | return res |
| 168 | } |
| 169 | |
| 170 | type wmscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm# struct { |
| 171 | wscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#w. *wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.Wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/Wildmatch# |
| 172 | pscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#p. string |
| 173 | } |
| 174 | |
| 175 | func (w *wmscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#) Matchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#Match().(filename string) bool { |
| 176 | return w.wscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#w..Matchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/Wildmatch#Match().(filename) |
| 177 | } |
| 178 | |
| 179 | func (w *wmscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#) Stringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#String().() string { |
| 180 | return w.pscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#p. |
| 181 | } |
| 182 | |
| 183 | const ( |
| 184 | sepscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/sep. byte = '/' |
| 185 | ) |
| 186 | |
| 187 | func NewPatternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/NewPattern().(p string, ptype PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#, gitEnv Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#) Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern# { |
| 188 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("filepathfilter: creating pattern %q of type %v", p, ptype) |
| 189 | |
| 190 | switch ptype { |
| 191 | case GitIgnorescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitIgnore.: |
| 192 | return &wmscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#{ |
| 193 | pscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#p.: p, |
| 194 | wscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#w.: wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.NewWildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/NewWildmatch().( |
| 195 | p, |
| 196 | caseFromConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/caseFromConfig().(gitEnv), |
| 197 | wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.Contentsscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/Contents., |
| 198 | ), |
| 199 | } |
| 200 | case GitAttributesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitAttributes.: |
| 201 | return &wmscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#{ |
| 202 | pscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#p.: p, |
| 203 | wscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/wm#w.: wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.NewWildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/NewWildmatch().( |
| 204 | p, |
| 205 | caseFromConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/caseFromConfig().(gitEnv), |
| 206 | wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.Basenamescip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/Basename., |
| 207 | wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.GitAttributesscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/GitAttributes., |
| 208 | ), |
| 209 | } |
| 210 | default: |
| 211 | panic(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("unreachable")) |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | // join joins path elements together via the separator "sep" and produces valid |
| 216 | // paths without multiple separators (unless multiple separators were included |
| 217 | // in the original paths []string). |
| 218 | func joinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/join().(paths ...string) string { |
| 219 | var joined string |
| 220 | |
| 221 | for i, path := range paths { |
| 222 | joined = joined + path |
| 223 | if i != len(paths)-1 && !stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.HasSuffixscip-go gomod github.com/golang/go/src go1.25.0 strings/HasSuffix().(path, string(sepscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/sep.)) { |
| 224 | joined = joined + string(sepscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/sep.) |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | return joined |
| 229 | } |
| 230 | |
| 231 | func convertToWildmatchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/convertToWildmatch().(rawpatterns []string, ptype PatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/PatternType#, gitEnv Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#) []Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern# { |
| 232 | patterns := make([]Patternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Pattern#, len(rawpatterns)) |
| 233 | for i, raw := range rawpatterns { |
| 234 | patterns[i] = NewPatternscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/NewPattern().(raw, ptype, gitEnv) |
| 235 | } |
| 236 | return patterns |
| 237 | } |
| 238 | |
| 239 | type Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment# interface { |
| 240 | Getscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#Get.(key string) (val string, ok bool) |
| 241 | Boolscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#Bool.(key string, def bool) (val bool) |
| 242 | } |
| 243 | |
| 244 | func caseFromConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/caseFromConfig().(gitEnv Environmentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#) func(w *wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.Wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/Wildmatch#) { |
| 245 | if gitEnv != nil && gitEnv.Boolscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Environment#Bool.("core.ignorecase", false) { |
| 246 | return wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.CaseFoldscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/CaseFold. |
| 247 | } else { |
| 248 | return func(w *wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/.Wildmatchscip-go gomod github.com/git-lfs/wildmatch/v2 v2.0.1 `github.com/git-lfs/wildmatch/v2`/Wildmatch#) {} |
| 249 | } |
| 250 | } |