Skip to content

Commit

Permalink
feat(spec): show error when loading two specs with the same name and …
Browse files Browse the repository at this point in the history
…a different url. Fixes #337
  • Loading branch information
folke committed Jan 7, 2023
1 parent 5ed89b5 commit c313249
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ end
function Spec:merge(old, new)
new._.dep = old._.dep and new._.dep

if new.url and old.url and new.url ~= old.url then
self:error("Two plugins with the same name and different url:\n" .. vim.inspect({ old = old, new = new }))
end

for _, prop in ipairs(list_merge) do
if new[prop] and old[prop] then
---@type any[]
Expand Down

0 comments on commit c313249

Please sign in to comment.