fix(render): show message if not yet committed (#707)

* fix(render): show message if not yet committed

* fix(render): show commit only if it can be shown
This commit is contained in:
futsuuu 2023-04-16 05:54:10 +09:00 committed by GitHub
parent 57cce98dfd
commit b7a1a0fbaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -499,7 +499,9 @@ function M:details(plugin)
if git.branch then if git.branch then
table.insert(props, { "branch", git.branch }) table.insert(props, { "branch", git.branch })
end end
table.insert(props, { "commit", git.commit:sub(1, 7), "LazyCommit" }) if git.commit then
table.insert(props, { "commit", git.commit:sub(1, 7), "LazyCommit" })
end
end end
if Util.file_exists(plugin.dir .. "/README.md") then if Util.file_exists(plugin.dir .. "/README.md") then
table.insert(props, { "readme", "README.md" }) table.insert(props, { "readme", "README.md" })