feat(git): support detached working trees (#2597)
* feat(git): support detached working trees closes #2595 * [docgen] Update doc/telescope.txt skip-checks: true * fix: use_file_path --------- Co-authored-by: Github Actions <actions@github>
This commit is contained in:
@@ -517,4 +517,22 @@ utils.__warn_no_selection = function(name)
|
||||
})
|
||||
end
|
||||
|
||||
--- Generate git command optionally with git env variables
|
||||
---@param args string[]
|
||||
---@param opts? table
|
||||
---@return string[]
|
||||
utils.__git_command = function(args, opts)
|
||||
opts = opts or {}
|
||||
|
||||
local _args = { "git" }
|
||||
if opts.gitdir then
|
||||
vim.list_extend(_args, { "--git-dir", opts.gitdir })
|
||||
end
|
||||
if opts.toplevel then
|
||||
vim.list_extend(_args, { "--work-tree", opts.toplevel })
|
||||
end
|
||||
|
||||
return vim.list_extend(_args, args)
|
||||
end
|
||||
|
||||
return utils
|
||||
|
||||
Reference in New Issue
Block a user