From 18d121833bc7b612d216261436946240f916f21f Mon Sep 17 00:00:00 2001 From: f Date: Sun, 21 Nov 2021 14:09:52 +0800 Subject: [PATCH] vim.fn.isdirectory(..) return 0/1 --- lua/lazygit.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 45e125f..5ce99bb 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -165,8 +165,9 @@ local function lazygit(path) if path == nil then path = project_root_dir() end - if path == nil or not fn.isdirectory(path .. '/.git/') then + if path == nil or fn.isdirectory(path .. '/.git/') == 0 then print('Not in a git repository') + return end open_floating_window() local cmd = 'lazygit'