@@ -186,26 +186,6 @@ function Explorer:reload(node, git_status)
186186 return node .nodes
187187end
188188
189- --- TODO #2837 #2871 #2886 move this and similar to node
190- --- Refresh contents and git status for a single node
191- --- @param node Node
192- --- @param callback function
193- function Explorer :refresh_node (node , callback )
194- if type (node ) ~= " table" then
195- callback ()
196- end
197-
198- local parent_node = utils .get_parent_of_group (node )
199-
200- self :reload_and_get_git_project (node .absolute_path , function (toplevel , project )
201- self :reload (parent_node , project )
202-
203- self :update_parent_statuses (parent_node , project , toplevel )
204-
205- callback ()
206- end )
207- end
208-
209189--- Refresh contents of all nodes to a path: actual directory and links.
210190--- Groups will be expanded if needed.
211191--- @param path string absolute path
@@ -233,7 +213,7 @@ function Explorer:refresh_parent_nodes_for_path(path)
233213 local project = git .get_project (toplevel ) or {}
234214
235215 self :reload (node , project )
236- self :update_parent_statuses (node , project , toplevel )
216+ node :update_parent_statuses (project , toplevel )
237217 end
238218
239219 log .profile_end (profile )
@@ -261,52 +241,6 @@ function Explorer:update_status(nodes_by_path, node_ignored, status)
261241 end
262242end
263243
264- --- TODO #2837 #2871 #2886 move this and similar to node
265- --- @private
266- --- @param path string
267- --- @param callback fun ( toplevel : string | nil , project : table | nil )
268- function Explorer :reload_and_get_git_project (path , callback )
269- local toplevel = git .get_toplevel (path )
270-
271- git .reload_project (toplevel , path , function ()
272- callback (toplevel , git .get_project (toplevel ) or {})
273- end )
274- end
275-
276- --- TODO #2837 #2871 #2886 move this and similar to node
277- --- @private
278- --- @param node Node
279- --- @param project table | nil
280- --- @param root string | nil
281- function Explorer :update_parent_statuses (node , project , root )
282- while project and node do
283- -- step up to the containing project
284- if node .absolute_path == root then
285- -- stop at the top of the tree
286- if not node .parent then
287- break
288- end
289-
290- root = git .get_toplevel (node .parent .absolute_path )
291-
292- -- stop when no more projects
293- if not root then
294- break
295- end
296-
297- -- update the containing project
298- project = git .get_project (root )
299- git .reload_project (root , node .absolute_path , nil )
300- end
301-
302- -- update status
303- node :update_git_status (node .parent and node .parent :is_git_ignored () or false , project )
304-
305- -- maybe parent
306- node = node .parent
307- end
308- end
309-
310244--- @private
311245--- @param handle uv.uv_fs_t
312246--- @param cwd string
0 commit comments