From bdea17cd4ef06d95344f9316c5d00ee3c04ca40c Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sun, 12 Apr 2020 06:16:01 -0600 Subject: [PATCH] Use finddir instead of rev-parse --- lua/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 93e45cc..18ffb58 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -13,7 +13,7 @@ local function is_lazygit_available() end local function project_root_dir() - return fn.system('cd ' .. fn.fnamemodify(fn.resolve(fn.expand('%:p')), ':h') .. ' && git rev-parse --show-toplevel 2> /dev/null') + return fn.finddir('.git/..', fn.expand('%:p:h') .. ';') end local function exec_lazygit_command(root_dir)