Skip to content

Commit

Permalink
should return nil if not directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmtmmnk committed Feb 27, 2021
1 parent a42457c commit fff89d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion filter/fuzzy.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ func (f *fuzzySearch) getFileNames(root string, limit int) ([]string, error) {
fsm := &fileSystem{}
fileNames := make([]string, 0, limit*2)
err := fs.WalkDir(fsm, root, func(path string, d fs.DirEntry, err error) error {
util.Logger.Debug(path)
if f.lookGitIgnore && f.gitIgnore.Match(path, d.IsDir()) {
return fs.SkipDir
if d.IsDir() {
return fs.SkipDir
}
return nil
}

// skip hidden directory or file
Expand All @@ -224,6 +228,7 @@ func (f *fuzzySearch) getFileNames(root string, limit int) ([]string, error) {
return nil
})
if err != nil {
util.Logger.Warn("walk error : ", err)
return []string{}, err
}
return fileNames, nil
Expand Down

0 comments on commit fff89d2

Please # to comment.