Skip to content

Commit 2a6a2dc

Browse files
committed
fix(git): tagrefs
1 parent a617d9f commit 2a6a2dc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/lazy/manage/git.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ function M.get_tag_refs(repo, tagref)
184184
tagref = tagref or "--tags"
185185
---@type table<string,string>
186186
local tags = {}
187-
local lines = Process.exec({ "git", "show-ref", "-d", tagref }, { cwd = repo })
187+
local ok, lines = pcall(function()
188+
return Process.exec({ "git", "show-ref", "-d", tagref }, { cwd = repo })
189+
end)
190+
if not ok then
191+
return {}
192+
end
188193
for _, line in ipairs(lines) do
189194
local ref, tag = line:match("^(%w+) refs/tags/([^%^]+)%^?{?}?$")
190195
if ref then

0 commit comments

Comments
 (0)