mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2024-09-16 14:34:09 +02:00
parent
7178d1a430
commit
e784e5a078
1 changed files with 5 additions and 3 deletions
|
@ -12,8 +12,8 @@ local M = {}
|
|||
local cwd_watcher ---@type uv.uv_fs_event_t?
|
||||
|
||||
--- @async
|
||||
--- @return string gitdir
|
||||
--- @return string head
|
||||
--- @return string? gitdir
|
||||
--- @return string? head
|
||||
local function get_gitdir_and_head()
|
||||
local cwd = assert(uv.cwd())
|
||||
|
||||
|
@ -31,7 +31,9 @@ local function get_gitdir_and_head()
|
|||
|
||||
local info = require('gitsigns.git').Repo.get_info(cwd)
|
||||
|
||||
return info.gitdir, info.abbrev_head
|
||||
if info then
|
||||
return info.gitdir, info.abbrev_head
|
||||
end
|
||||
end
|
||||
|
||||
local update_cwd_head = async.create(function()
|
||||
|
|
Loading…
Reference in a new issue