diff options
| author | PolarMutex <115141+polarmutex@users.noreply.github.com> | 2021-04-22 13:23:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-22 13:23:42 -0400 |
| commit | 0d6cd47990781ea760dd3db578015c140c7b9fa7 (patch) | |
| tree | 380542639e59f15ccdbb22c3d096473a0684d968 /lua/telescope/builtin/git.lua | |
| parent | 3adeab2bed42597c8495fbe3a2376c746232f2e3 (diff) | |
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>
Diffstat (limited to 'lua/telescope/builtin/git.lua')
| -rw-r--r-- | lua/telescope/builtin/git.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lua/telescope/builtin/git.lua b/lua/telescope/builtin/git.lua index 198abae..d708126 100644 --- a/lua/telescope/builtin/git.lua +++ b/lua/telescope/builtin/git.lua @@ -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] |
