aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-03-12 21:09:39 +0100
committerChristian Clason <christian.clason@uni-due.de>2022-03-12 22:59:47 +0100
commitccb55be88f82456a46db46cc9a533d08aed35081 (patch)
treeca7784fc68e8f10e79fd1e01405f34230b7fd18a /lua
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.tar
nvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.tar.gz
nvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.tar.bz2
nvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.tar.lz
nvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.tar.xz
nvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.tar.zst
nvim-treesitter-ccb55be88f82456a46db46cc9a533d08aed35081.zip
fix(solidity): follow install_info.branch on parser update
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/install.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index b16143950..b65c4b3f0 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -514,7 +514,17 @@ function M.write_lockfile(verbose, skip_langs)
for _, v in ipairs(sorted_parsers) do
if not vim.tbl_contains(skip_langs, v.name) then
-- I'm sure this can be done in aync way with iter_cmd
- local sha = vim.split(vim.fn.systemlist("git ls-remote " .. v.parser.install_info.url)[1], "\t")[1]
+ local sha
+ if v.parser.install_info.branch then
+ sha = vim.split(
+ vim.fn.systemlist(
+ "git ls-remote " .. v.parser.install_info.url .. " | grep refs/heads/" .. v.parser.install_info.branch
+ )[1],
+ "\t"
+ )[1]
+ else
+ sha = vim.split(vim.fn.systemlist("git ls-remote " .. v.parser.install_info.url)[1], "\t")[1]
+ end
lockfile[v.name] = { revision = sha }
if verbose then
print(v.name .. ": " .. sha)