Skip to content

Commit fde310e

Browse files
authored
Merge pull request #339 from erizocosmico/fix/pattern-matches-macos
gitbase: ignore .DS_Store files in darwin
2 parents f155d2a + 60d58e5 commit fde310e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

path_utils.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ func PatternMatches(pattern string) (int, []string, error) {
2525

2626
depth := PatternPrefixDepth(abs)
2727

28-
return depth, matches, nil
28+
return depth, removeDsStore(matches), nil
29+
}
30+
31+
func removeDsStore(matches []string) []string {
32+
var result []string
33+
for _, m := range matches {
34+
if filepath.Base(m) != ".DS_Store" {
35+
result = append(result, m)
36+
}
37+
}
38+
return result
2939
}
3040

3141
// PatternPrefixDepth returns the number of directories before the first

0 commit comments

Comments
 (0)