Skip to content

Commit

Permalink
fix: add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Jul 11, 2024
1 parent 375c44b commit 7178d1a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/gitsigns/git/repo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ end

--- @async
function M:update_abbrev_head()
self.abbrev_head = M.get_info(self.toplevel).abbrev_head
local info = M.get_info(self.toplevel)
if not info then
log.eprintf('Could not get info for repo at %s', self.gitdir)
return
end
self.abbrev_head = info.abbrev_head
end

--- @async
Expand Down

0 comments on commit 7178d1a

Please sign in to comment.