on main help sign in
refactor: simplify
ae421e2Carlos Alexandro Becker
internal/fsext/fileutil.go+3−5
@@ -143,19 +143,17 @@ func (w *FastGlobWalker) shouldSkip(path string) bool {
143
143
144 relPath, err := filepath.Rel(w.rootPath, path)
144 relPath, err := filepath.Rel(w.rootPath, path)
145 if err != nil {
145 if err != nil {
146− relPath = path
146+ return false
147 }
147 }
148
148
149− // Check gitignore patterns if available
150 if w.gitignore != nil {
149 if w.gitignore != nil {
151− if err == nil && w.gitignore.MatchesPath(relPath) {
150+ if w.gitignore.MatchesPath(relPath) {
152 return true
151 return true
153 }
152 }
154 }
153 }
155
154
156− // Check crushignore patterns if available
157 if w.crushignore != nil {
155 if w.crushignore != nil {
158− if err == nil && w.crushignore.MatchesPath(relPath) {
156+ if w.crushignore.MatchesPath(relPath) {
159 return true
157 return true
160 }
158 }
161 }
159 }