mirror of https://github.com/folke/lazy.nvim.git
fix(git): only check for new commits for local plugins. Closes #1512
This commit is contained in:
parent
933f0b596c
commit
81d2bfffdc
|
@ -148,6 +148,14 @@ function M.get_target(plugin)
|
||||||
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
|
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
|
||||||
end
|
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, ...)
|
function M.ref(repo, ...)
|
||||||
local ref = table.concat({ ... }, "/")
|
local ref = table.concat({ ... }, "/")
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ M.log = {
|
||||||
table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
|
table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
|
||||||
elseif opts.check then
|
elseif opts.check then
|
||||||
local info = assert(Git.info(self.plugin.dir))
|
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
|
if not target.commit then
|
||||||
for k, v in pairs(target) do
|
for k, v in pairs(target) do
|
||||||
error(k .. " '" .. v .. "' not found")
|
error(k .. " '" .. v .. "' not found")
|
||||||
|
|
Loading…
Reference in New Issue