Skip to content

Commit 81d2bff

Browse files
committed
fix(git): only check for new commits for local plugins. Closes #1512
1 parent 933f0b5 commit 81d2bff

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lua/lazy/manage/git.lua

+8
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ function M.get_target(plugin)
148148
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
149149
end
150150

151+
---@param plugin LazyPlugin
152+
---@return GitInfo?
153+
function M.get_local_target(plugin)
154+
local info = M.info(plugin.dir)
155+
local branch = assert(info and info.branch or M.get_branch(plugin))
156+
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
157+
end
158+
151159
function M.ref(repo, ...)
152160
local ref = table.concat({ ... }, "/")
153161

lua/lazy/manage/task/git.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ M.log = {
3636
table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
3737
elseif opts.check then
3838
local info = assert(Git.info(self.plugin.dir))
39-
local target = assert(Git.get_target(self.plugin))
39+
local target = assert(self.plugin._.is_local and Git.get_local_target(self.plugin) or Git.get_target(self.plugin))
4040
if not target.commit then
4141
for k, v in pairs(target) do
4242
error(k .. " '" .. v .. "' not found")

0 commit comments

Comments
 (0)