fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

Avoid setting git author name in test (#944)

This fixes an annoying problem where after running `go test ./...` locally,
your local git `user.name` would be set to `thomas`.

+8 -3
+8 -3
internal/gitindex/index_test.go
··· 92 92 executeCommand(t, dir, exec.Command("git", "init", "-b", "main", "repo")) 93 93 94 94 repoDir := filepath.Join(dir, "repo") 95 - executeCommand(t, repoDir, exec.Command("git", "config", "--local", "user.name", "Thomas")) 96 - executeCommand(t, repoDir, exec.Command("git", "config", "--local", "user.email", "thomas@google.com")) 97 - 98 95 if err := os.WriteFile(filepath.Join(repoDir, "file1.go"), []byte("package main\n\nfunc main() {}\n"), 0644); err != nil { 99 96 t.Fatalf("WriteFile: %v", err) 100 97 } ··· 136 133 137 134 func executeCommand(t *testing.T, dir string, cmd *exec.Cmd) *exec.Cmd { 138 135 cmd.Dir = dir 136 + cmd.Env = []string{ 137 + "GIT_CONFIG_GLOBAL=", 138 + "GIT_CONFIG_SYSTEM=", 139 + "GIT_COMMITTER_NAME=Kierkegaard", 140 + "GIT_COMMITTER_EMAIL=soren@apache.com", 141 + "GIT_AUTHOR_NAME=Kierkegaard", 142 + "GIT_AUTHOR_EMAIL=soren@apache.com", 143 + } 139 144 if err := cmd.Run(); err != nil { 140 145 t.Fatalf("cmd.Run: %v", err) 141 146 }