@@ -183,26 +183,6 @@ function Explorer:reload(node, git_status)
183183 return node .nodes
184184end
185185
186- --- TODO #2837 #2871 #2886 move this and similar to node
187- --- Refresh contents and git status for a single node
188- --- @param node Node
189- --- @param callback function
190- function Explorer :refresh_node (node , callback )
191- if type (node ) ~= " table" then
192- callback ()
193- end
194-
195- local parent_node = utils .get_parent_of_group (node )
196-
197- self :reload_and_get_git_project (node .absolute_path , function (toplevel , project )
198- self :reload (parent_node , project )
199-
200- self :update_parent_statuses (parent_node , project , toplevel )
201-
202- callback ()
203- end )
204- end
205-
206186--- Refresh contents of all nodes to a path: actual directory and links.
207187--- Groups will be expanded if needed.
208188--- @param path string absolute path
@@ -230,7 +210,7 @@ function Explorer:refresh_parent_nodes_for_path(path)
230210 local project = git .get_project (toplevel ) or {}
231211
232212 self :reload (node , project )
233- self :update_parent_statuses (node , project , toplevel )
213+ node :update_parent_statuses (project , toplevel )
234214 end
235215
236216 log .profile_end (profile )
@@ -258,52 +238,6 @@ function Explorer:update_status(nodes_by_path, node_ignored, status)
258238 end
259239end
260240
261- --- TODO #2837 #2871 #2886 move this and similar to node
262- --- @private
263- --- @param path string
264- --- @param callback fun ( toplevel : string | nil , project : table | nil )
265- function Explorer :reload_and_get_git_project (path , callback )
266- local toplevel = git .get_toplevel (path )
267-
268- git .reload_project (toplevel , path , function ()
269- callback (toplevel , git .get_project (toplevel ) or {})
270- end )
271- end
272-
273- --- TODO #2837 #2871 #2886 move this and similar to node
274- --- @private
275- --- @param node Node
276- --- @param project table | nil
277- --- @param root string | nil
278- function Explorer :update_parent_statuses (node , project , root )
279- while project and node do
280- -- step up to the containing project
281- if node .absolute_path == root then
282- -- stop at the top of the tree
283- if not node .parent then
284- break
285- end
286-
287- root = git .get_toplevel (node .parent .absolute_path )
288-
289- -- stop when no more projects
290- if not root then
291- break
292- end
293-
294- -- update the containing project
295- project = git .get_project (root )
296- git .reload_project (root , node .absolute_path , nil )
297- end
298-
299- -- update status
300- node :update_git_status (node .parent and node .parent :is_git_ignored () or false , project )
301-
302- -- maybe parent
303- node = node .parent
304- end
305- end
306-
307241--- @private
308242--- @param handle uv.uv_fs_t
309243--- @param cwd string
0 commit comments