Skip to content

Commit 4425136

Browse files
authored
perf(#3171): cache toplevel for untracked (#3185)
1 parent 000ca6b commit 4425136

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/nvim-tree/git/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ function M.get_toplevel(path)
193193
end
194194
end
195195

196-
-- attempt to fetch toplevel
196+
-- attempt to fetch toplevel, cache if untracked
197197
local toplevel, git_dir = git_utils.get_toplevel(path)
198198
if not toplevel or not git_dir then
199+
M._toplevels_by_path[path] = false
199200
return nil
200201
end
201202
local toplevel_norm = vim.fn.fnamemodify(toplevel, ":p")

0 commit comments

Comments
 (0)