mirror of https://github.com/folke/lazy.nvim.git
fix(git): tagrefs
This commit is contained in:
parent
a617d9f47b
commit
2a6a2dce1b
|
@ -184,7 +184,12 @@ function M.get_tag_refs(repo, tagref)
|
||||||
tagref = tagref or "--tags"
|
tagref = tagref or "--tags"
|
||||||
---@type table<string,string>
|
---@type table<string,string>
|
||||||
local tags = {}
|
local tags = {}
|
||||||
local lines = Process.exec({ "git", "show-ref", "-d", tagref }, { cwd = repo })
|
local ok, lines = pcall(function()
|
||||||
|
return Process.exec({ "git", "show-ref", "-d", tagref }, { cwd = repo })
|
||||||
|
end)
|
||||||
|
if not ok then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
for _, line in ipairs(lines) do
|
for _, line in ipairs(lines) do
|
||||||
local ref, tag = line:match("^(%w+) refs/tags/([^%^]+)%^?{?}?$")
|
local ref, tag = line:match("^(%w+) refs/tags/([^%^]+)%^?{?}?$")
|
||||||
if ref then
|
if ref then
|
||||||
|
|
Loading…
Reference in New Issue