fix checking for git dir in a bare repo (#757)
* fix checking for git dir in a bare repo * revert last change and look for worktree * fix lint error * [docgen] Update doc/telescope.txt skip-checks: true Co-authored-by: Brian Ryall <brian.ryall@udri.udayton.edu> Co-authored-by: Github Actions <actions@github>
This commit is contained in:
@@ -244,7 +244,10 @@ local set_opts_cwd = function(opts)
|
||||
local use_git_root = utils.get_default(opts.use_git_root, true)
|
||||
|
||||
if ret ~= 0 then
|
||||
error(opts.cwd .. ' is not a git directory')
|
||||
local is_worktree = utils.get_os_command_output({ "git", "rev-parse", "--is-inside-work-tree" }, opts.cwd)
|
||||
if is_worktree == "false" then
|
||||
error(opts.cwd .. ' is not a git directory')
|
||||
end
|
||||
else
|
||||
if use_git_root then
|
||||
opts.cwd = git_root[1]
|
||||
|
||||
Reference in New Issue
Block a user