feat(git): per-key cache invalidation and optional submodule tracking
This commit is contained in:
@@ -73,4 +73,25 @@ function M.make_repo(files, opts)
|
||||
return dir
|
||||
end
|
||||
|
||||
---Build an outer repo with one nested submodule at `sub/`. Both the
|
||||
---outer and inner repo are committed and registered for cleanup.
|
||||
---@return string outer
|
||||
---@return string inner
|
||||
function M.make_submodule_repo()
|
||||
local inner = M.make_repo({ a = "x\n" })
|
||||
local outer = M.make_repo({ x = "x\n" })
|
||||
vim.system({
|
||||
"git",
|
||||
"-c",
|
||||
"protocol.file.allow=always",
|
||||
"submodule",
|
||||
"add",
|
||||
"--quiet",
|
||||
inner,
|
||||
"sub",
|
||||
}, { cwd = outer, text = true }):wait()
|
||||
M.git(outer, "commit", "-q", "-m", "add submodule")
|
||||
return outer, inner
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user