From d278dc40f9de9980868a0a55fa666fba5e6aeacb Mon Sep 17 00:00:00 2001 From: Sebastian Oberhoff Date: Sun, 11 Jan 2026 22:55:32 +0100 Subject: [PATCH] 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. --- lua/oil/fs.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/oil/fs.lua b/lua/oil/fs.lua index a9ae10c..f169c0b 100644 --- a/lua/oil/fs.lua +++ b/lua/oil/fs.lua @@ -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