mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-20 05:16:45 +00:00
feat(git): Plugin.submodules = false
will now skip fetching git submodules
This commit is contained in:
parent
4917222c7e
commit
0d3f2c4042
3 changed files with 15 additions and 4 deletions
|
@ -70,10 +70,11 @@ M.clone = {
|
|||
args[#args + 1] = "--filter=blob:none"
|
||||
end
|
||||
|
||||
vim.list_extend(args, {
|
||||
"--recurse-submodules",
|
||||
"--progress",
|
||||
})
|
||||
if self.plugin.submodules ~= false then
|
||||
args[#args + 1] = "--recurse-submodules"
|
||||
end
|
||||
|
||||
args[#args + 1] = "--progress"
|
||||
|
||||
if self.plugin.branch then
|
||||
vim.list_extend(args, { "-b", self.plugin.branch })
|
||||
|
@ -158,6 +159,10 @@ M.fetch = {
|
|||
"--progress",
|
||||
}
|
||||
|
||||
if self.plugin.submodules == false then
|
||||
table.remove(args, 2)
|
||||
end
|
||||
|
||||
self:spawn("git", {
|
||||
args = args,
|
||||
cwd = self.plugin.dir,
|
||||
|
@ -209,6 +214,10 @@ M.checkout = {
|
|||
"--recurse-submodules",
|
||||
}
|
||||
|
||||
if self.plugin.submodules == false then
|
||||
table.remove(args, 3)
|
||||
end
|
||||
|
||||
if lock then
|
||||
table.insert(args, lock.commit)
|
||||
elseif target.tag then
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
---@field commit? string
|
||||
---@field version? string
|
||||
---@field pin? boolean
|
||||
---@field submodules? boolean Defaults to true
|
||||
|
||||
---@class LazyPluginBase
|
||||
---@field [1] string?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue