MCPcopy Create free account
hub / github.com/LunaSource/Luna / ShouldIgnoreFile

Function ShouldIgnoreFile

git/git.go:36–59  ·  view source on GitHub ↗
(filename string, cfg config.Config)

Source from the content-addressed store, hash-verified

34}
35
36func ShouldIgnoreFile(filename string, cfg config.Config) bool {
37 for _, ignoredFile := range cfg.IgnoredFiles {
38 if filename == ignoredFile {
39 return true
40 }
41 if strings.HasSuffix(ignoredFile, "/") && strings.HasPrefix(filename, ignoredFile) {
42 return true
43 }
44 }
45
46 for _, pattern := range cfg.IgnoredPatterns {
47 matched, _ := filepath.Match(pattern, filepath.Base(filename))
48 if matched {
49 return true
50 }
51 fullPattern := filepath.FromSlash(pattern)
52 matched, _ = filepath.Match(fullPattern, filename)
53 if matched {
54 return true
55 }
56 }
57
58 return false
59}

Callers 1

processNextFileFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected