mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 12:30:01 -04:00
fix(solidity): follow install_info.branch on parser update
This commit is contained in:
parent
69a02b88d8
commit
ccb55be88f
1 changed files with 11 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue