Import: Ignore dot files listed in .ppignore #1348

This commit is contained in:
Michael Mayer 2021-07-16 18:27:28 +02:00
parent 07c711a0b4
commit 97c3e0abe8

View file

@ -45,7 +45,7 @@ func (i IgnoreItem) Ignore(dir, base string) bool {
return false
}
// IgnoreItem represents a list of name patterns to be ignored.
// IgnoreList represents a list of name patterns to be ignored.
type IgnoreList struct {
Log IgnoreLogFunc
items []IgnoreItem
@ -144,11 +144,6 @@ func (l *IgnoreList) Ignore(fileName string) bool {
return true
}
if l.ignoreHidden && strings.HasPrefix(filepath.Base(fileName), ".") {
l.hiddenFiles = append(l.hiddenFiles, fileName)
return true
}
for _, item := range l.items {
if item.Ignore(dir, base) {
l.ignoredFiles = append(l.ignoredFiles, fileName)
@ -161,5 +156,10 @@ func (l *IgnoreList) Ignore(fileName string) bool {
}
}
if l.ignoreHidden && strings.HasPrefix(filepath.Base(fileName), ".") {
l.hiddenFiles = append(l.hiddenFiles, fileName)
return true
}
return false
}