Skip to content

Commit bfe4935

Browse files
authored
fix(ci): fix env of a unit test
fix(ci): fix env of a unit test
2 parents 08d0d32 + d3c4e2b commit bfe4935

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/integration/empty_repo_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@ func TestEmptyRepository(t *testing.T) {
2121
}
2222

2323
// Configure git user
24-
exec.Command("git", "config", "user.email", "[email protected]").Run()
25-
exec.Command("git", "config", "user.name", "Test User").Run()
24+
configEmailCmd := exec.Command("git", "config", "user.email", "[email protected]")
25+
configEmailCmd.Dir = tmpDir
26+
if err := configEmailCmd.Run(); err != nil {
27+
t.Fatalf("Failed to configure git user.email: %v", err)
28+
}
29+
30+
configNameCmd := exec.Command("git", "config", "user.name", "Test User")
31+
configNameCmd.Dir = tmpDir
32+
if err := configNameCmd.Run(); err != nil {
33+
t.Fatalf("Failed to configure git user.name: %v", err)
34+
}
2635

2736
// Create a test file
2837
testFile := filepath.Join(tmpDir, "test.txt")

0 commit comments

Comments
 (0)