From a1d1567ad95fb0a01e492458bea65acb6d8738a5 Mon Sep 17 00:00:00 2001 From: futsuuu Date: Fri, 31 Mar 2023 16:46:54 +0900 Subject: [PATCH] fix(render): show message if not yet committed --- lua/lazy/view/render.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index 91b8756..a2af2c3 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -499,7 +499,11 @@ function M:details(plugin) if git.branch then table.insert(props, { "branch", git.branch }) 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" }) + else + table.insert(props, { "commit", "No commits yet" }) + end end if Util.file_exists(plugin.dir .. "/README.md") then table.insert(props, { "readme", "README.md" })