Skip to content

Commit

Permalink
fix(git): better errors when a branch/tag/version could not be found. F…
Browse files Browse the repository at this point in the history
…ixes #276
  • Loading branch information
folke committed Jan 2, 2023
1 parent 85173dc commit 277a2ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/lazy/manage/task/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 277a2ab

Please sign in to comment.