Skip to content

Commit

Permalink
fix(git): only check for new commits for local plugins. Closes #1512
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 7, 2024
1 parent 933f0b5 commit 81d2bff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lua/lazy/manage/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ function M.get_target(plugin)
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
end

---@param plugin LazyPlugin
---@return GitInfo?
function M.get_local_target(plugin)
local info = M.info(plugin.dir)
local branch = assert(info and info.branch or M.get_branch(plugin))
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
end

function M.ref(repo, ...)
local ref = table.concat({ ... }, "/")

Expand Down
2 changes: 1 addition & 1 deletion lua/lazy/manage/task/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ M.log = {
table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
elseif opts.check then
local info = assert(Git.info(self.plugin.dir))
local target = assert(Git.get_target(self.plugin))
local target = assert(self.plugin._.is_local and Git.get_local_target(self.plugin) or Git.get_target(self.plugin))
if not target.commit then
for k, v in pairs(target) do
error(k .. " '" .. v .. "' not found")
Expand Down

0 comments on commit 81d2bff

Please sign in to comment.