Skip to content

Commit caed010

Browse files
committed
chore: resolve undefined-field
1 parent c8b6848 commit caed010

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lua/nvim-tree/explorer/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ end
339339
---@param nodes_by_path Node[]
340340
---@param node_ignored boolean
341341
---@param project GitProject?
342-
---@return fun(node: Node): table
342+
---@return fun(node: Node): Node
343343
function Explorer:update_git_statuses(nodes_by_path, node_ignored, project)
344344
return function(node)
345345
if nodes_by_path[node.absolute_path] then

lua/nvim-tree/git/utils.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,21 @@ end
132132

133133
---Git file status for an absolute path
134134
---@param parent_ignored boolean
135-
---@param status table?
135+
---@param project GitProject?
136136
---@param path string
137137
---@param path_fallback string? alternative file path when no other file status
138138
---@return GitNodeStatus
139-
function M.git_status_file(parent_ignored, status, path, path_fallback)
139+
function M.git_status_file(parent_ignored, project, path, path_fallback)
140140
---@type GitNodeStatus
141141
local ns
142142

143143
if parent_ignored then
144144
ns = {
145145
file = "!!"
146146
}
147-
elseif status and status.files then
147+
elseif project and project.files then
148148
ns = {
149-
file = status.files[path] or status.files[path_fallback]
149+
file = project.files[path] or project.files[path_fallback]
150150
}
151151
else
152152
ns = {}
@@ -157,24 +157,24 @@ end
157157

158158
---Git file and directory status for an absolute path
159159
---@param parent_ignored boolean
160-
---@param status table?
160+
---@param project GitProject?
161161
---@param path string
162162
---@param path_fallback string? alternative file path when no other file status
163163
---@return GitNodeStatus?
164-
function M.git_status_dir(parent_ignored, status, path, path_fallback)
164+
function M.git_status_dir(parent_ignored, project, path, path_fallback)
165165
---@type GitNodeStatus?
166166
local ns
167167

168168
if parent_ignored then
169169
ns = {
170170
file = "!!"
171171
}
172-
elseif status then
172+
elseif project then
173173
ns = {
174-
file = status.files and (status.files[path] or status.files[path_fallback]),
175-
dir = status.dirs and {
176-
direct = status.dirs.direct and status.dirs.direct[path],
177-
indirect = status.dirs.indirect and status.dirs.indirect[path],
174+
file = project.files and (project.files[path] or project.files[path_fallback]),
175+
dir = project.dirs and {
176+
direct = project.dirs.direct and project.dirs.direct[path],
177+
indirect = project.dirs.indirect and project.dirs.indirect[path],
178178
},
179179
}
180180
end

0 commit comments

Comments
 (0)