chore: resolve undefined-field
This commit is contained in:
@@ -339,7 +339,7 @@ end
|
|||||||
---@param nodes_by_path Node[]
|
---@param nodes_by_path Node[]
|
||||||
---@param node_ignored boolean
|
---@param node_ignored boolean
|
||||||
---@param project GitProject?
|
---@param project GitProject?
|
||||||
---@return fun(node: Node): table
|
---@return fun(node: Node): Node
|
||||||
function Explorer:update_git_statuses(nodes_by_path, node_ignored, project)
|
function Explorer:update_git_statuses(nodes_by_path, node_ignored, project)
|
||||||
return function(node)
|
return function(node)
|
||||||
if nodes_by_path[node.absolute_path] then
|
if nodes_by_path[node.absolute_path] then
|
||||||
|
|||||||
@@ -132,11 +132,11 @@ end
|
|||||||
|
|
||||||
---Git file status for an absolute path
|
---Git file status for an absolute path
|
||||||
---@param parent_ignored boolean
|
---@param parent_ignored boolean
|
||||||
---@param status table?
|
---@param project GitProject?
|
||||||
---@param path string
|
---@param path string
|
||||||
---@param path_fallback string? alternative file path when no other file status
|
---@param path_fallback string? alternative file path when no other file status
|
||||||
---@return GitNodeStatus
|
---@return GitNodeStatus
|
||||||
function M.git_status_file(parent_ignored, status, path, path_fallback)
|
function M.git_status_file(parent_ignored, project, path, path_fallback)
|
||||||
---@type GitNodeStatus
|
---@type GitNodeStatus
|
||||||
local ns
|
local ns
|
||||||
|
|
||||||
@@ -144,9 +144,9 @@ function M.git_status_file(parent_ignored, status, path, path_fallback)
|
|||||||
ns = {
|
ns = {
|
||||||
file = "!!"
|
file = "!!"
|
||||||
}
|
}
|
||||||
elseif status and status.files then
|
elseif project and project.files then
|
||||||
ns = {
|
ns = {
|
||||||
file = status.files[path] or status.files[path_fallback]
|
file = project.files[path] or project.files[path_fallback]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ns = {}
|
ns = {}
|
||||||
@@ -157,11 +157,11 @@ end
|
|||||||
|
|
||||||
---Git file and directory status for an absolute path
|
---Git file and directory status for an absolute path
|
||||||
---@param parent_ignored boolean
|
---@param parent_ignored boolean
|
||||||
---@param status table?
|
---@param project GitProject?
|
||||||
---@param path string
|
---@param path string
|
||||||
---@param path_fallback string? alternative file path when no other file status
|
---@param path_fallback string? alternative file path when no other file status
|
||||||
---@return GitNodeStatus?
|
---@return GitNodeStatus?
|
||||||
function M.git_status_dir(parent_ignored, status, path, path_fallback)
|
function M.git_status_dir(parent_ignored, project, path, path_fallback)
|
||||||
---@type GitNodeStatus?
|
---@type GitNodeStatus?
|
||||||
local ns
|
local ns
|
||||||
|
|
||||||
@@ -169,12 +169,12 @@ function M.git_status_dir(parent_ignored, status, path, path_fallback)
|
|||||||
ns = {
|
ns = {
|
||||||
file = "!!"
|
file = "!!"
|
||||||
}
|
}
|
||||||
elseif status then
|
elseif project then
|
||||||
ns = {
|
ns = {
|
||||||
file = status.files and (status.files[path] or status.files[path_fallback]),
|
file = project.files and (project.files[path] or project.files[path_fallback]),
|
||||||
dir = status.dirs and {
|
dir = project.dirs and {
|
||||||
direct = status.dirs.direct and status.dirs.direct[path],
|
direct = project.dirs.direct and project.dirs.direct[path],
|
||||||
indirect = status.dirs.indirect and status.dirs.indirect[path],
|
indirect = project.dirs.indirect and project.dirs.indirect[path],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user