diff options
| author | William Boman <william@redwill.se> | 2022-05-19 00:07:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-19 00:07:50 +0200 |
| commit | ec532c36eeed36ded785696727a85a9a00f71f22 (patch) | |
| tree | 69d7b97b34ab873fdf3c55b60b43c399f27b35ab /lua/nvim-lsp-installer/core/managers/git | |
| parent | run autogen_metadata.lua (diff) | |
| download | mason-ec532c36eeed36ded785696727a85a9a00f71f22.tar mason-ec532c36eeed36ded785696727a85a9a00f71f22.tar.gz mason-ec532c36eeed36ded785696727a85a9a00f71f22.tar.bz2 mason-ec532c36eeed36ded785696727a85a9a00f71f22.tar.lz mason-ec532c36eeed36ded785696727a85a9a00f71f22.tar.xz mason-ec532c36eeed36ded785696727a85a9a00f71f22.tar.zst mason-ec532c36eeed36ded785696727a85a9a00f71f22.zip | |
fix(erlangls): follow git tags (#708)
Closes #683.
Diffstat (limited to 'lua/nvim-lsp-installer/core/managers/git')
| -rw-r--r-- | lua/nvim-lsp-installer/core/managers/git/init.lua | 5 |
1 files changed, 3 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 6efa10b9..559703c9 100644 --- a/lua/nvim-lsp-installer/core/managers/git/init.lua +++ b/lua/nvim-lsp-installer/core/managers/git/init.lua @@ -1,6 +1,7 @@ local spawn = require "nvim-lsp-installer.core.spawn" local Result = require "nvim-lsp-installer.core.result" local installer = require "nvim-lsp-installer.core.installer" +local _ = require "nvim-lsp-installer.core.functional" local M = {} @@ -13,7 +14,7 @@ local function with_receipt(repo) end ---@async ----@param opts {[1]: string, recursive: boolean} @The first item in the table is the repository to clone. +---@param opts {[1]: string, recursive: boolean, version: Optional|nil} @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.") @@ -25,7 +26,7 @@ function M.clone(opts) repo, ".", } - ctx.requested_version:if_present(function(version) + _.coalesce(opts.version, ctx.requested_version):if_present(function(version) ctx.spawn.git { "fetch", "--depth", "1", "origin", version } ctx.spawn.git { "checkout", "FETCH_HEAD" } end) |
