fix(git): unset GIT_DIR when spawning a process. Fixes #434

This commit is contained in:
Folke Lemaitre 2023-01-20 20:41:29 +01:00
parent 75dcd5741d
commit 9858001c3c
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 1 deletions

View File

@ -68,8 +68,10 @@ function M.spawn(cmd, opts)
for key, value in for key, value in
pairs(uv.os_environ() --[[@as string[] ]]) pairs(uv.os_environ() --[[@as string[] ]])
do do
if key ~= "GIT_DIR" then
table.insert(env, key .. "=" .. value) table.insert(env, key .. "=" .. value)
end end
end
local stdout = uv.new_pipe() local stdout = uv.new_pipe()
local stderr = uv.new_pipe() local stderr = uv.new_pipe()