fix(sshfs): use stat to get the filetype when fs_scandir does not return the type

This commit is contained in:
kiyan
2021-06-30 22:29:11 +02:00
parent d311c22d46
commit 7abec5e594

View File

@@ -290,7 +290,13 @@ function M.populate(entries, cwd, parent_node)
local name, t = luv.fs_scandir_next(handle) local name, t = luv.fs_scandir_next(handle)
if not name then break end if not name then break end
if not should_ignore(utils.path_join({cwd, name})) then local abs = utils.path_join({cwd, name})
if not should_ignore(abs) then
if not t then
local stat = luv.fs_stat(abs)
t = stat and stat.type
end
if t == 'directory' then if t == 'directory' then
table.insert(dirs, name) table.insert(dirs, name)
elseif t == 'file' then elseif t == 'file' then