Skip to content

Commit d288c90

Browse files
Copilotsand4rt
andauthored
fix: init real tmp git repo with user identity for commit test
Agent-Logs-Url: https://github.com/sand4rt/zen.nvim/sessions/a652929b-24dc-4980-b03f-05568d133994 Co-authored-by: sand4rt <17591696+sand4rt@users.noreply.github.com>
1 parent 1854f97 commit d288c90

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_integrations.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ T["top integration"]["opening an integration should close the existing integrati
196196
end
197197

198198
T["top integration"]["closing a stacked top split returns cursor to the integration below it"] = function()
199+
-- initialize a real temporary git repo with user identity so that
200+
-- "Git commit --allow-empty" works deterministically in CI
201+
child.lua([[
202+
local tmpdir = vim.fn.tempname()
203+
vim.fn.mkdir(tmpdir, "p")
204+
vim.fn.system({ "git", "init", tmpdir })
205+
vim.fn.system({ "git", "-C", tmpdir, "config", "user.name", "Test" })
206+
vim.fn.system({ "git", "-C", tmpdir, "config", "user.email", "test@test.com" })
207+
vim.fn.chdir(tmpdir)
208+
]])
199209
child.cmd("Git")
200210

201211
Helpers.expect.layout(child, {

0 commit comments

Comments
 (0)