@@ -10,8 +10,6 @@ import (
1010 "time"
1111
1212 "code.gitea.io/gitea/modules/log"
13-
14- "github.com/gobwas/glob"
1513)
1614
1715// Indexer settings
@@ -30,8 +28,8 @@ var Indexer = struct {
3028 RepoConnStr string
3129 RepoIndexerName string
3230 MaxIndexerFileSize int64
33- IncludePatterns []glob. Glob
34- ExcludePatterns []glob. Glob
31+ IncludePatterns []* GlobMatcher
32+ ExcludePatterns []* GlobMatcher
3533 ExcludeVendored bool
3634}{
3735 IssueType : "bleve" ,
@@ -93,12 +91,12 @@ func loadIndexerFrom(rootCfg ConfigProvider) {
9391}
9492
9593// IndexerGlobFromString parses a comma separated list of patterns and returns a glob.Glob slice suited for repo indexing
96- func IndexerGlobFromString (globstr string ) []glob. Glob {
97- extarr := make ([]glob. Glob , 0 , 10 )
94+ func IndexerGlobFromString (globstr string ) []* GlobMatcher {
95+ extarr := make ([]* GlobMatcher , 0 , 10 )
9896 for _ , expr := range strings .Split (strings .ToLower (globstr ), "," ) {
9997 expr = strings .TrimSpace (expr )
10098 if expr != "" {
101- if g , err := glob . Compile (expr , '.' , '/' ); err != nil {
99+ if g , err := GlobMatcherCompile (expr , '.' , '/' ); err != nil {
102100 log .Info ("Invalid glob expression '%s' (skipped): %v" , expr , err )
103101 } else {
104102 extarr = append (extarr , g )
0 commit comments