revert(#2794): sshfs compatibility (#2920)

* refactor(#2875): multi instance renderer: remove unused code

* Revert "fix(#2794): sshfs compatibility (#2893)"

This reverts commit 2d6e64dd8c.
This commit is contained in:
Alexander Courtis
2024-09-22 15:23:42 +10:00
committed by GitHub
parent 0ae9ad4ded
commit 8405ecfbd6
2 changed files with 7 additions and 15 deletions

View File

@@ -57,18 +57,13 @@ local function remove_dir(cwd)
end
while true do
local name, _ = vim.loop.fs_scandir_next(handle)
local name, t = vim.loop.fs_scandir_next(handle)
if not name then
break
end
local new_cwd = utils.path_join { cwd, name }
-- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
local stat = vim.loop.fs_stat(new_cwd)
local type = stat and stat.type or nil
if type == "directory" then
if t == "directory" then
local success = remove_dir(new_cwd)
if not success then
return false