fix: git mv errors when moving empty directory (#358)

This commit is contained in:
Steven Arcangeli 2024-04-23 19:31:54 -07:00
parent 2edb43a7ec
commit 6a7a10b611

View file

@ -96,7 +96,10 @@ M.mv = function(entry_type, src_path, dest_path, cb)
on_exit = function(_, code)
if code ~= 0 then
stderr = vim.trim(stderr)
if stderr:match("^fatal: not under version control") then
if
stderr:match("^fatal: not under version control")
or stderr:match("^fatal: source directory is empty")
then
fs.recursive_move(entry_type, src_path, dest_path, cb)
else
cb("Error in git mv: " .. stderr)