fix: harden git status updates (#2533)

* fix for nil status error messages

* simplify logic

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Matt W
2023-11-18 19:43:36 -08:00
committed by GitHub
parent 52a1c99bf0
commit 633811c53d

View File

@@ -14,6 +14,7 @@ local function get_dir_git_status(parent_ignored, status, absolute_path)
return { file = "!!" }
end
if status then
return {
file = status.files and status.files[absolute_path],
dir = status.dirs and {
@@ -22,6 +23,7 @@ local function get_dir_git_status(parent_ignored, status, absolute_path)
},
}
end
end
local function get_git_status(parent_ignored, status, absolute_path)
local file_status = parent_ignored and "!!" or status.files and status.files[absolute_path]