From 5b6b23a3a275626187ad0fbd25604b126cc6de73 Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Wed, 2 Jun 2021 06:27:32 +0900 Subject: [PATCH] fix: correctly check output of git worktree command (#882) --- lua/telescope/builtin/git.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/telescope/builtin/git.lua b/lua/telescope/builtin/git.lua index ae03019..0a2d5dc 100644 --- a/lua/telescope/builtin/git.lua +++ b/lua/telescope/builtin/git.lua @@ -265,8 +265,8 @@ local set_opts_cwd = function(opts) local use_git_root = utils.get_default(opts.use_git_root, true) if ret ~= 0 then - local is_worktree = utils.get_os_command_output({ "git", "rev-parse", "--is-inside-work-tree" }, opts.cwd) - if is_worktree == "false" then + local output = utils.get_os_command_output({ "git", "rev-parse", "--is-inside-work-tree" }, opts.cwd) + if output[1] ~= "true" then error(opts.cwd .. ' is not a git directory') end else