fix: process deletes in dir before moving dir

This commit is contained in:
Steven Arcangeli 2024-08-25 20:46:46 -07:00
parent a632c898fb
commit 349bca8c3e
2 changed files with 23 additions and 4 deletions

View file

@ -252,11 +252,10 @@ M.enforce_action_order = function(actions)
-- Process children before moving
-- e.g. NEW /a/b BEFORE MOVE /a -> /b
dest_trie:accum_children_of(action.src_url, ret)
-- Copy children before moving parent dir
-- Process children before moving parent dir
-- e.g. COPY /a/b -> /b BEFORE MOVE /a -> /d
src_trie:accum_children_of(action.src_url, ret, function(a)
return a.type == "copy"
end)
-- e.g. CHANGE /a/b BEFORE MOVE /a -> /d
src_trie:accum_children_of(action.src_url, ret)
-- Process remove path before moving to new path
-- e.g. MOVE /a -> /b BEFORE MOVE /c -> /a
src_trie:accum_actions_at(action.dest_url, ret, function(a)