fix: correctly check output of git worktree command (#882)
This commit is contained in:
@@ -265,8 +265,8 @@ local set_opts_cwd = function(opts)
|
|||||||
local use_git_root = utils.get_default(opts.use_git_root, true)
|
local use_git_root = utils.get_default(opts.use_git_root, true)
|
||||||
|
|
||||||
if ret ~= 0 then
|
if ret ~= 0 then
|
||||||
local is_worktree = utils.get_os_command_output({ "git", "rev-parse", "--is-inside-work-tree" }, opts.cwd)
|
local output = utils.get_os_command_output({ "git", "rev-parse", "--is-inside-work-tree" }, opts.cwd)
|
||||||
if is_worktree == "false" then
|
if output[1] ~= "true" then
|
||||||
error(opts.cwd .. ' is not a git directory')
|
error(opts.cwd .. ' is not a git directory')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user