Skip to content

Commit

Permalink
fix(git): allow path to not have git_state to request
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 committed Mar 15, 2024
1 parent 10ebb5e commit fb7f23b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/pathlib/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ function M.request_git_status_update(path, args)
if path:is_dir(true) then
return
end
if not path.git_state or not path.git_state.git_root then
local root = M.find_root(path)
if not root then
return
end
path.git_state = path.git_state or {}
path.git_state.git_root = root
end
if not utils.is_done(path.git_state.is_ready) then
pcall(path.git_state.is_ready.wait)
end
Expand Down

0 comments on commit fb7f23b

Please sign in to comment.