mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
tests: Allow lfs.attributes to be NULL when traversing FS
This commit is contained in:
@@ -30,13 +30,15 @@ local function glob(initial_path, re, exc_re)
|
|||||||
if ((not exc_re or not checked_path:match(exc_re))
|
if ((not exc_re or not checked_path:match(exc_re))
|
||||||
and e:sub(1, 1) ~= '.') then
|
and e:sub(1, 1) ~= '.') then
|
||||||
local attrs = lfs.attributes(full_path)
|
local attrs = lfs.attributes(full_path)
|
||||||
local check_key = attrs.dev .. ':' .. tostring(attrs.ino)
|
if attrs then
|
||||||
if not checked_files[check_key] then
|
local check_key = attrs.dev .. ':' .. tostring(attrs.ino)
|
||||||
checked_files[check_key] = true
|
if not checked_files[check_key] then
|
||||||
if attrs.mode == 'directory' then
|
checked_files[check_key] = true
|
||||||
paths_to_check[#paths_to_check + 1] = full_path
|
if attrs.mode == 'directory' then
|
||||||
elseif not re or checked_path:match(re) then
|
paths_to_check[#paths_to_check + 1] = full_path
|
||||||
ret[#ret + 1] = full_path
|
elseif not re or checked_path:match(re) then
|
||||||
|
ret[#ret + 1] = full_path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user