fix: correctly check output of git worktree command (#882)

This commit is contained in:
Jose Alvarez
2021-06-02 06:27:32 +09:00
committed by GitHub
parent 57ac8dcc3e
commit 5b6b23a3a2

View File

@@ -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