git-codereview: set user.name and user.email before tests

The tests should not assume that the user running the tests have
global user.name and user.email settings in ~/.gitconfig. This
applies especially to the builder machines.

Fixes golang/go#9342, and golang/go#9433.

Change-Id: Ic1c973b133586edfa6dce3a169b7512db113fcc6
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/2117
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/git-codereview/util_test.go b/git-codereview/util_test.go
index 0be544a..9b3e81f 100644
--- a/git-codereview/util_test.go
+++ b/git-codereview/util_test.go
@@ -52,6 +52,8 @@
 	mkdir(t, server)
 	write(t, server+"/file", "this is master")
 	trun(t, server, "git", "init", ".")
+	trun(t, server, "git", "config", "user.name", "gopher")
+	trun(t, server, "git", "config", "user.email", "gopher@example.com")
 	trun(t, server, "git", "add", "file")
 	trun(t, server, "git", "commit", "-m", "on master")
 
@@ -65,6 +67,8 @@
 	client := tmpdir + "/git-client"
 	mkdir(t, client)
 	trun(t, client, "git", "clone", server, ".")
+	trun(t, client, "git", "config", "user.name", "gopher")
+	trun(t, client, "git", "config", "user.email", "gopher@example.com")
 
 	// write stub hooks to keep installHook from installing its own.
 	// If it installs its own, git will look for git-codereview on the current path