From 2a6a2dce1b14f35e7eb7cbe8f25202ed83cba697 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 28 Jun 2024 18:31:10 +0200 Subject: [PATCH] fix(git): tagrefs --- lua/lazy/manage/git.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazy/manage/git.lua b/lua/lazy/manage/git.lua index 6b0ab58..a365824 100644 --- a/lua/lazy/manage/git.lua +++ b/lua/lazy/manage/git.lua @@ -184,7 +184,12 @@ function M.get_tag_refs(repo, tagref) tagref = tagref or "--tags" ---@type table 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