Skip to content

Commit c90d350

Browse files
authored
fix(test): isolate .git/config updates
fix(test): isolate .git/config updates
2 parents e6ed1df + 83b52c8 commit c90d350

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/integration/empty_repo_test.go

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

2323
// Configure git user
24-
configEmailCmd := exec.Command("git", "config", "user.email", "[email protected]")
24+
configEmailCmd := exec.Command("git", "config", "--local", "user.email", "[email protected]")
2525
configEmailCmd.Dir = tmpDir
2626
if err := configEmailCmd.Run(); err != nil {
2727
t.Fatalf("Failed to configure git user.email: %v", err)
2828
}
2929

30-
configNameCmd := exec.Command("git", "config", "user.name", "Test User")
30+
configNameCmd := exec.Command("git", "config", "--local", "user.name", "Test User")
3131
configNameCmd.Dir = tmpDir
3232
if err := configNameCmd.Run(); err != nil {
3333
t.Fatalf("Failed to configure git user.name: %v", err)

tests/integration/git_commit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func setupTestRepo(t *testing.T) string {
2828

2929
// Configure Git user (required for commits)
3030
configCmds := [][]string{
31-
{"config", "user.name", "Test User"},
32-
{"config", "user.email", "[email protected]"},
31+
{"config", "--local", "user.name", "Test User"},
32+
{"config", "--local", "user.email", "[email protected]"},
3333
}
3434
for _, args := range configCmds {
3535
cmd := exec.Command("git", args...)

0 commit comments

Comments
 (0)