fix: propagate errors in recursive_delete and recursive_copy (#712)

The `complete` callback checks `err` instead of `err2`, but `err` is
always nil inside the `elseif entries` branch. This silently ignores
child operation errors, causing misleading "directory not empty" failures.
This commit is contained in:
Sebastian Oberhoff 2026-01-11 22:55:32 +01:00 committed by GitHub
parent 43227c5a1c
commit d278dc40f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -218,7 +218,7 @@ M.recursive_delete = function(entry_type, path, cb)
local waiting = #entries
local complete
complete = function(err2)
if err then
if err2 then
complete = function() end
return inner_cb(err2)
end
@ -320,7 +320,7 @@ M.recursive_copy = function(entry_type, src_path, dest_path, cb)
local waiting = #entries
local complete
complete = function(err2)
if err then
if err2 then
complete = function() end
return inner_cb(err2)
end