Skip to content

Commit a4a6e6c

Browse files
committed
chore: resolve undefined-field
1 parent 4372e6a commit a4a6e6c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lua/nvim-tree/git/init.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ local function path_ignored_in_project(path, project)
8282
end
8383

8484
if project.files then
85-
for file, status in pairs(project.files) do
86-
if status == "!!" and vim.startswith(path, file) then
85+
for p, xy in pairs(project.files) do
86+
if xy == "!!" and vim.startswith(path, p) then
8787
return true
8888
end
8989
end
@@ -235,13 +235,13 @@ local function reload_tree_at(toplevel)
235235
end
236236

237237
M.reload_project(toplevel, nil, function()
238-
local git_status = M.get_project(toplevel)
238+
local project = M.get_project(toplevel)
239239

240240
Iterator.builder(root_node.nodes)
241241
:hidden()
242242
:applier(function(node)
243243
local parent_ignored = node.parent and node.parent:is_git_ignored() or false
244-
node:update_git_status(parent_ignored, git_status)
244+
node:update_git_status(parent_ignored, project)
245245
end)
246246
:recursor(function(node)
247247
return node.nodes and #node.nodes > 0 and node.nodes
@@ -371,9 +371,9 @@ function M.reload_node_status(dir, projects)
371371
end
372372

373373
local toplevel = M.get_toplevel(dir.absolute_path)
374-
local status = projects[toplevel] or {}
374+
local project = projects[toplevel] or {}
375375
for _, node in ipairs(dir.nodes) do
376-
node:update_git_status(dir:is_git_ignored(), status)
376+
node:update_git_status(dir:is_git_ignored(), project)
377377
M.reload_node_status(node:as(DirectoryNode), projects)
378378
end
379379
end

lua/nvim-tree/git/runner.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ function GitRunner:finalise()
205205
end
206206
end
207207

208+
---Return nil when callback present
208209
---@private
209-
---@return GitPathXY? statuses nil if callback present
210+
---@return GitPathXY?
210211
function GitRunner:execute()
211212
local async = self.opts.callback ~= nil
212213
local profile = log.profile_start("git %s job %s %s", async and "async" or "sync", self.opts.toplevel, self.opts.path)
@@ -238,8 +239,9 @@ function GitRunner:execute()
238239
end
239240

240241
---Static method to run a git process, which will be killed if it takes more than timeout
242+
---Return nil when callback present
241243
---@param opts GitRunnerOpts
242-
---@return GitPathXY? statuses nil if callback present
244+
---@return GitPathXY?
243245
function GitRunner:run(opts)
244246
---@type GitRunner
245247
local runner = {

0 commit comments

Comments
 (0)