diff --git a/lua/oil/mutator/init.lua b/lua/oil/mutator/init.lua index e2488ed..5f08749 100644 --- a/lua/oil/mutator/init.lua +++ b/lua/oil/mutator/init.lua @@ -289,7 +289,7 @@ M.enforce_action_order = function(actions) -- We've detected a move cycle (e.g. MOVE /a -> /b + MOVE /b -> /a) -- Split one of the moves and retry local intermediate_url = - string.format("%s__oil_tmp_%05d", loop_action.src_url, math.random(999999)) + string.format("%s__oil_tmp_%05d", loop_action.src_url, math.random(999999)) local move_1 = { type = "move", entry_type = loop_action.entry_type, diff --git a/tests/mutator_spec.lua b/tests/mutator_spec.lua index 6eeae4a..f13add0 100644 --- a/tests/mutator_spec.lua +++ b/tests/mutator_spec.lua @@ -195,7 +195,7 @@ a.describe("mutator", function() }) local diffs = parser.parse(bufnr) assert.are.same({ - { type = "new", id = file[FIELD_ID], name = "b.txt", entry_type = "file" }, + { type = "new", id = file[FIELD_ID], name = "b.txt", entry_type = "file" }, { type = "delete", id = file[FIELD_ID], name = "a.txt" }, }, diffs) end) @@ -314,7 +314,7 @@ a.describe("mutator", function() local bufnr = vim.api.nvim_get_current_buf() local diffs = { { type = "delete", name = "a.txt", id = file[FIELD_ID] }, - { type = "new", name = "b.txt", entry_type = "file", id = file[FIELD_ID] }, + { type = "new", name = "b.txt", entry_type = "file", id = file[FIELD_ID] }, } local actions = mutator.create_actions_from_diffs({ [bufnr] = diffs, @@ -335,8 +335,8 @@ a.describe("mutator", function() local bufnr = vim.api.nvim_get_current_buf() local diffs = { { type = "delete", name = "a.txt", id = file[FIELD_ID] }, - { type = "new", name = "b.txt", entry_type = "file", id = file[FIELD_ID] }, - { type = "new", name = "a.txt", entry_type = "file" }, + { type = "new", name = "b.txt", entry_type = "file", id = file[FIELD_ID] }, + { type = "new", name = "a.txt", entry_type = "file" }, } local actions = mutator.create_actions_from_diffs({ [bufnr] = diffs, @@ -363,9 +363,9 @@ a.describe("mutator", function() local bufnr = vim.api.nvim_get_current_buf() local diffs = { { type = "delete", name = "a.txt", id = afile[FIELD_ID] }, - { type = "new", name = "b.txt", entry_type = "file", id = afile[FIELD_ID] }, + { type = "new", name = "b.txt", entry_type = "file", id = afile[FIELD_ID] }, { type = "delete", name = "b.txt", id = bfile[FIELD_ID] }, - { type = "new", name = "a.txt", entry_type = "file", id = bfile[FIELD_ID] }, + { type = "new", name = "a.txt", entry_type = "file", id = bfile[FIELD_ID] }, } math.randomseed(2983982) local actions = mutator.create_actions_from_diffs({