mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(git): properly compare git commits with short refs
This commit is contained in:
parent
3ad6d95a30
commit
dc9c92a9b3
3 changed files with 11 additions and 3 deletions
|
@ -32,6 +32,14 @@ function M.info(repo, details)
|
|||
end
|
||||
end
|
||||
|
||||
---@param a GitInfo
|
||||
---@param b GitInfo
|
||||
function M.eq(a, b)
|
||||
local ra = a.commit and a.commit:sub(1, 7)
|
||||
local rb = b.commit and b.commit:sub(1, 7)
|
||||
return ra == rb
|
||||
end
|
||||
|
||||
function M.head(repo)
|
||||
return Util.head(repo .. "/.git/HEAD")
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue