fix(#2386): kill git zombies (#2401)

This commit is contained in:
Alexander Courtis 2023-09-03 17:26:05 +10:00 committed by GitHub
parent 277632fbd9
commit 5897b3622f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,12 +89,14 @@ function Runner:_run_git_job(callback)
stderr:read_stop() stderr:read_stop()
stdout:close() stdout:close()
stderr:close() stderr:close()
if handle then
-- don't close the handle when killing as it will leave a zombie
if rc == -1 then
pcall(vim.loop.kill, pid, "sigkill")
elseif handle then
handle:close() handle:close()
end end
pcall(vim.loop.kill, pid)
if callback then if callback then
callback() callback()
end end