mirror of
https://github.com/neovim/neovim.git
synced 2026-05-23 21:30:11 +00:00
fix(pack): GIT_DIR/GIT_WORK_TREE env vars may interfere #39279
Problem: With GIT_DIR/GIT_WORK_TREE set, the LSP on the vim.pack.update() confirmation buffer does not show the correct git log on hover. Solution: Temporarily remove the git vars from the environment.
This commit is contained in:
@@ -218,7 +218,11 @@ methods['textDocument/hover'] = function(params, callback)
|
||||
local res = { contents = { kind = vim.lsp.protocol.MarkupKind.Markdown, value = markdown } }
|
||||
callback(nil, res)
|
||||
end
|
||||
vim.system(cmd, { cwd = path }, vim.schedule_wrap(on_exit))
|
||||
|
||||
-- temporarily clear GIT env vars
|
||||
local env = vim.fn.environ() --- @type table<string,string>
|
||||
env.GIT_DIR, env.GIT_WORK_TREE = nil, nil
|
||||
vim.system(cmd, { cwd = path, env = env, clear_env = true }, vim.schedule_wrap(on_exit))
|
||||
end
|
||||
|
||||
local dispatchers = {}
|
||||
|
||||
Reference in New Issue
Block a user