From 277a2ab10baeebf64548a6b5a606d7b82f8e3165 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 2 Jan 2023 19:01:02 +0100 Subject: [PATCH] fix(git): better errors when a branch/tag/version could not be found. Fixes #276 --- lua/lazy/manage/task/git.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazy/manage/task/git.lua b/lua/lazy/manage/task/git.lua index 376245d..d94d769 100644 --- a/lua/lazy/manage/task/git.lua +++ b/lua/lazy/manage/task/git.lua @@ -34,6 +34,12 @@ M.log = { elseif opts.check then local info = assert(Git.info(self.plugin.dir)) local target = assert(Git.get_target(self.plugin)) + if not target.commit then + for k, v in pairs(target) do + error(k .. " '" .. v .. "' not found") + end + error("no target commit found") + end assert(target.commit, self.plugin.name .. " " .. target.branch) if target.commit ~= info.commit then self.plugin._.updates = { from = info, to = target }