feat(git): submodule recursion on by default
This commit is contained in:
+8
-16
@@ -218,21 +218,13 @@ t.test("refresh emits change.paths listing structurally-changed paths", function
|
||||
t.falsy(change.paths["b"], "b is unchanged structurally")
|
||||
end)
|
||||
|
||||
t.test("submodule: parent enumerates initialized submodules with flag on", function()
|
||||
vim.g.git_submodule_recursion = true
|
||||
t.defer(function()
|
||||
vim.g.git_submodule_recursion = nil
|
||||
end)
|
||||
t.test("submodule: parent enumerates initialized submodules by default", function()
|
||||
local outer_path = h.make_submodule_repo()
|
||||
local outer = assert(require("git.core.repo").resolve(outer_path))
|
||||
t.truthy(outer._submodules["sub"], "sub recorded as submodule")
|
||||
end)
|
||||
|
||||
t.test("submodule: recursion flag eagerly creates child Repos and subscribes", function()
|
||||
vim.g.git_submodule_recursion = true
|
||||
t.defer(function()
|
||||
vim.g.git_submodule_recursion = nil
|
||||
end)
|
||||
t.test("submodule: eagerly creates child Repos and subscribes by default", function()
|
||||
local outer_path = h.make_submodule_repo()
|
||||
local outer = assert(require("git.core.repo").resolve(outer_path))
|
||||
wait_initial(outer)
|
||||
@@ -257,23 +249,23 @@ t.test("submodule: recursion flag eagerly creates child Repos and subscribes", f
|
||||
t.eq(entry.kind, "changed")
|
||||
end)
|
||||
|
||||
t.test("submodule: no eager creation when flag is off", function()
|
||||
t.test("submodule: no eager creation when flag is explicitly disabled", function()
|
||||
vim.g.git_submodule_recursion = false
|
||||
t.defer(function()
|
||||
vim.g.git_submodule_recursion = nil
|
||||
end)
|
||||
local outer_path = h.make_submodule_repo()
|
||||
local outer = assert(require("git.core.repo").resolve(outer_path))
|
||||
wait_initial(outer)
|
||||
t.eq(
|
||||
require("git.core.repo").all()[outer_path .. "/sub"],
|
||||
nil,
|
||||
"inner Repo not created when flag off"
|
||||
"inner Repo not created when flag is false"
|
||||
)
|
||||
t.eq(next(outer._submodules), nil)
|
||||
end)
|
||||
|
||||
t.test("submodule: outer created after inner picks up existing child", function()
|
||||
vim.g.git_submodule_recursion = true
|
||||
t.defer(function()
|
||||
vim.g.git_submodule_recursion = nil
|
||||
end)
|
||||
local outer_path = h.make_submodule_repo()
|
||||
local inner = assert(
|
||||
require("git.core.repo").resolve(outer_path .. "/sub")
|
||||
|
||||
Reference in New Issue
Block a user