Skip to content

Commit

Permalink
Add a comment for the watcher callback nil filename check.
Browse files Browse the repository at this point in the history
  • Loading branch information
otrho committed Aug 9, 2023
1 parent ffcdbc6 commit d3d7654
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/gitsigns/watcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ function M.watch_gitdir(bufnr, gitdir)

local info = string.format("Git dir update: '%s' %s", filename, inspect(events))

-- The luv docs say filename is passed as a string but it has been observed
-- to sometimes be nil.
-- https://github.com/lewis6991/gitsigns.nvim/issues/848
if filename == nil or vim.endswith(filename, '.lock') then
dprintf('%s (ignoring)', info)
return
Expand Down

0 comments on commit d3d7654

Please sign in to comment.