fix(git): Fix the gitignore implementation. (#335)
This commit is contained in:
@@ -27,7 +27,6 @@ M.Tree = {
|
||||
function M.init(with_open, with_reload)
|
||||
M.Tree.cwd = luv.cwd()
|
||||
git.git_root(M.Tree.cwd)
|
||||
git.update_gitignore_map_sync()
|
||||
populate(M.Tree.entries, M.Tree.cwd)
|
||||
|
||||
local stat = luv.fs_stat(M.Tree.cwd)
|
||||
@@ -118,7 +117,6 @@ function M.unroll_dir(node)
|
||||
renderer.draw(M.Tree, true)
|
||||
else
|
||||
git.git_root(node.absolute_path)
|
||||
git.update_gitignore_map_sync()
|
||||
populate(node.entries, node.link_to or node.absolute_path, node)
|
||||
|
||||
renderer.draw(M.Tree, true)
|
||||
@@ -129,15 +127,12 @@ function M.unroll_dir(node)
|
||||
end
|
||||
end
|
||||
|
||||
local function refresh_git(node, update_gitignore)
|
||||
local function refresh_git(node)
|
||||
if not node then node = M.Tree end
|
||||
if update_gitignore == nil or update_gitignore == true then
|
||||
git.update_gitignore_map_sync()
|
||||
end
|
||||
git.update_status(node.entries, node.absolute_path or node.cwd, node)
|
||||
for _, entry in pairs(node.entries) do
|
||||
if entry.entries and #entry.entries > 0 then
|
||||
refresh_git(entry, false)
|
||||
refresh_git(entry)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user