Skip to content

Commit fb7f23b

Browse files
committed
fix(git): allow path to not have git_state to request
1 parent 10ebb5e commit fb7f23b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/pathlib/git.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ function M.request_git_status_update(path, args)
311311
if path:is_dir(true) then
312312
return
313313
end
314+
if not path.git_state or not path.git_state.git_root then
315+
local root = M.find_root(path)
316+
if not root then
317+
return
318+
end
319+
path.git_state = path.git_state or {}
320+
path.git_state.git_root = root
321+
end
314322
if not utils.is_done(path.git_state.is_ready) then
315323
pcall(path.git_state.is_ready.wait)
316324
end

0 commit comments

Comments
 (0)