Skip to content

Commit a797d08

Browse files
authored
feat (Search): Ignore .git folder (#114)
1 parent 3235175 commit a797d08

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ type Configuration struct {
357357
// SearchRecursion holds the configuration for directory search recursion settings.
358358
type SearchRecursion struct {
359359
// BlacklistedDirs is a list of directory names that should be excluded from the recursion.
360-
BlacklistedDirs []string `default:"[\"node_modules\", \".wine\", \"appcache\", \"depotcache\", \"vendor\"]" yaml:"blacklisted_dirs" json:"blacklisted_dirs"`
360+
BlacklistedDirs []string `default:"[\"node_modules\", \".git\", \".wine\", \"appcache\", \"depotcache\", \"vendor\"]" yaml:"blacklisted_dirs" json:"blacklisted_dirs"`
361361

362362
// MaxRecursionDepth specifies the maximum depth for directory recursion.
363363
MaxRecursionDepth int `default:"8" yaml:"max_recursion_depth" json:"max_recursion_depth"`

router/router_server_files_search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ func appendMatchedEntry(matchedEntries *[]filesystem.Stat, fileInfo ufs.FileInfo
3838
// todo make this config value work as now it cause a panic
3939
//var blacklist = config.Get().SearchRecursion.BlacklistedDirs
4040

41-
var blacklist = []string{"node_modules", ".wine", "appcache", "depotcache", "vendor"}
41+
var blacklist = []string{"node_modules", ".wine", ".git", "appcache", "depotcache", "vendor"}
4242

4343
// Helper function to check if a directory name is in the blacklist
4444
func isBlacklisted(dirName string) bool {
4545
for _, blacklisted := range blacklist {
46-
if strings.Contains(dirName, strings.ToLower(blacklisted)) {
46+
if strings.EqualFold(dirName, strings.ToLower(blacklisted)) {
4747
return true
4848
}
4949
}

0 commit comments

Comments
 (0)