diff --git a/file.go b/file.go index 919d4db..28f600b 100644 --- a/file.go +++ b/file.go @@ -464,8 +464,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, // 2. one or more match // for #1 this means we should include the file // for #2 this means the last one wins since it should be the most correct - if ignore.MatchIsDir(joined, false) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, false); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonGitignore } else { @@ -476,8 +476,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, for _, ignore := range ignores { // same rules as above - if ignore.MatchIsDir(joined, false) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, false); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonIgnoreFile } else { @@ -488,8 +488,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, for _, ignore := range customIgnores { // same rules as above - if ignore.MatchIsDir(joined, false) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, false); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonCustomIgnore } else { @@ -646,8 +646,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, // 2. one or more match // for #1 this means we should include the file // for #2 this means the last one wins since it should be the most correct - if ignore.MatchIsDir(joined, true) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, true); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonGitignore } else { @@ -657,8 +657,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, } for _, ignore := range ignores { // same rules as above - if ignore.MatchIsDir(joined, true) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, true); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonIgnoreFile } else { @@ -668,8 +668,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, } for _, ignore := range customIgnores { // same rules as above - if ignore.MatchIsDir(joined, true) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, true); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonCustomIgnore } else { @@ -679,8 +679,8 @@ func (f *FileWalker) walkDirectoryRecursive(iteration int, } for _, ignore := range moduleIgnores { // same rules as above - if ignore.MatchIsDir(joined, true) != nil { - shouldIgnore = ignore.Ignore(joined) + if m := ignore.MatchIsDir(joined, true); m != nil { + shouldIgnore = m.Ignore() if shouldIgnore { skipReason = SkipReasonModuleIgnore } else {