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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,13 +14,15 @@ local function get_dir_git_status(parent_ignored, status, absolute_path)
return { file = "!!" }
end
return {
file = status.files and status.files[absolute_path],
dir = status.dirs and {
direct = status.dirs.direct[absolute_path],
indirect = status.dirs.indirect[absolute_path],
},
}
if status then
return {
file = status.files and status.files[absolute_path],
dir = status.dirs and {
direct = status.dirs.direct[absolute_path],
indirect = status.dirs.indirect[absolute_path],
},
}
end
end
local function get_git_status(parent_ignored, status, absolute_path)