Skip to content

Commit

Permalink
fix(git): tagrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 28, 2024
1 parent a617d9f commit 2a6a2dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/lazy/manage/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ function M.get_tag_refs(repo, tagref)
tagref = tagref or "--tags"
---@type table<string,string>
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
local ref, tag = line:match("^(%w+) refs/tags/([^%^]+)%^?{?}?$")
if ref then
Expand Down

0 comments on commit 2a6a2dc

Please sign in to comment.