Skip to content

Commit 90f2cf4

Browse files
authored
fix: don't populate git status when git unused (nvim-tree#499)
1 parent 76583b7 commit 90f2cf4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lua/nvim-tree/lib.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ function M.init(with_open, with_reload)
2828
if not M.Tree.cwd then
2929
M.Tree.cwd = luv.cwd()
3030
end
31-
git.git_root(M.Tree.cwd)
31+
if config.use_git() then
32+
git.git_root(M.Tree.cwd)
33+
end
3234
populate(M.Tree.entries, M.Tree.cwd)
3335

3436
local stat = luv.fs_stat(M.Tree.cwd)
@@ -130,7 +132,9 @@ function M.unroll_dir(node)
130132
if #node.entries > 0 then
131133
renderer.draw(M.Tree, true)
132134
else
133-
git.git_root(node.absolute_path)
135+
if config.use_git() then
136+
git.git_root(node.absolute_path)
137+
end
134138
populate(node.entries, node.link_to or node.absolute_path, node)
135139

136140
renderer.draw(M.Tree, true)

lua/nvim-tree/populate.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ function M.populate(entries, cwd, parent_node)
354354
return
355355
end
356356

357-
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
357+
if config.use_git() then
358+
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
359+
end
358360
end
359361

360362
return M

0 commit comments

Comments
 (0)