fix: don't populate git status when git unused (#499)

This commit is contained in:
Andrew Wong
2021-07-10 18:05:53 +10:00
committed by GitHub
parent 933d69a37f
commit 64aacb67ab
2 changed files with 9 additions and 3 deletions

View File

@@ -28,7 +28,9 @@ function M.init(with_open, with_reload)
if not M.Tree.cwd then
M.Tree.cwd = luv.cwd()
end
git.git_root(M.Tree.cwd)
if config.use_git() then
git.git_root(M.Tree.cwd)
end
populate(M.Tree.entries, M.Tree.cwd)
local stat = luv.fs_stat(M.Tree.cwd)
@@ -130,7 +132,9 @@ function M.unroll_dir(node)
if #node.entries > 0 then
renderer.draw(M.Tree, true)
else
git.git_root(node.absolute_path)
if config.use_git() then
git.git_root(node.absolute_path)
end
populate(node.entries, node.link_to or node.absolute_path, node)
renderer.draw(M.Tree, true)