File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -338,17 +338,19 @@ function M.refresh_dir(dir)
338338 end )
339339end
340340
341- --- @param n DirectoryNode
341+ --- @param dir DirectoryNode ?
342342--- @param projects table
343- function M .reload_node_status (n , projects )
344- local toplevel = M .get_toplevel (n .absolute_path )
343+ function M .reload_node_status (dir , projects )
344+ dir = dir and dir :as (DirectoryNode )
345+ if not dir or # dir .nodes == 0 then
346+ return
347+ end
348+
349+ local toplevel = M .get_toplevel (dir .absolute_path )
345350 local status = projects [toplevel ] or {}
346- for _ , node in ipairs (n .nodes ) do
347- node :update_git_status (n :is_git_ignored (), status )
348- local dir = node :as (DirectoryNode )
349- if dir and # dir .nodes > 0 then
350- dir :reload_node_status (projects )
351- end
351+ for _ , node in ipairs (dir .nodes ) do
352+ node :update_git_status (dir :is_git_ignored (), status )
353+ M .reload_node_status (node :as (DirectoryNode ), projects )
352354 end
353355end
354356
You can’t perform that action at this time.
0 commit comments