aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/core/managers/git
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-21 12:09:59 +0200
committerGitHub <noreply@github.com>2022-04-21 12:09:59 +0200
commitb68fcc6bb2c770495ff8e2508c06dfdd49abcc80 (patch)
treedf7c71efb59958deb21a18eeccf3e3c43c4cd704 /lua/nvim-lsp-installer/core/managers/git
parentrun autogen_metadata.lua (diff)
downloadmason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.gz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.bz2
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.lz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.xz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.zst
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.zip
chore: refactor remaining installers to async impl (#616)
Diffstat (limited to 'lua/nvim-lsp-installer/core/managers/git')
-rw-r--r--lua/nvim-lsp-installer/core/managers/git/init.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/lua/nvim-lsp-installer/core/managers/git/init.lua b/lua/nvim-lsp-installer/core/managers/git/init.lua
index f3c6ee65..6efa10b9 100644
--- a/lua/nvim-lsp-installer/core/managers/git/init.lua
+++ b/lua/nvim-lsp-installer/core/managers/git/init.lua
@@ -13,11 +13,18 @@ local function with_receipt(repo)
end
---@async
----@param opts {[1]:string} @The first item in the table is the repository to clone.
+---@param opts {[1]: string, recursive: boolean} @The first item in the table is the repository to clone.
function M.clone(opts)
local ctx = installer.context()
local repo = assert(opts[1], "No git URL provided.")
- ctx.spawn.git { "clone", "--depth", "1", repo, "." }
+ ctx.spawn.git {
+ "clone",
+ "--depth",
+ "1",
+ opts.recursive and "--recursive" or vim.NIL,
+ repo,
+ ".",
+ }
ctx.requested_version:if_present(function(version)
ctx.spawn.git { "fetch", "--depth", "1", "origin", version }
ctx.spawn.git { "checkout", "FETCH_HEAD" }