From d3c4e2b62801778a4bf4012ed057e51267682660 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 14 Nov 2025 09:12:54 +0100 Subject: [PATCH] fix(ci): fix env of a unit test --- tests/integration/empty_repo_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/integration/empty_repo_test.go b/tests/integration/empty_repo_test.go index 34d57c0..cf2774f 100644 --- a/tests/integration/empty_repo_test.go +++ b/tests/integration/empty_repo_test.go @@ -21,8 +21,17 @@ func TestEmptyRepository(t *testing.T) { } // Configure git user - exec.Command("git", "config", "user.email", "test@test.com").Run() - exec.Command("git", "config", "user.name", "Test User").Run() + configEmailCmd := exec.Command("git", "config", "user.email", "test@test.com") + configEmailCmd.Dir = tmpDir + if err := configEmailCmd.Run(); err != nil { + t.Fatalf("Failed to configure git user.email: %v", err) + } + + configNameCmd := exec.Command("git", "config", "user.name", "Test User") + configNameCmd.Dir = tmpDir + if err := configNameCmd.Run(); err != nil { + t.Fatalf("Failed to configure git user.name: %v", err) + } // Create a test file testFile := filepath.Join(tmpDir, "test.txt")