diff options
| author | Shenghou Ma <minux@golang.org> | 2014-12-23 19:50:43 -0500 |
|---|---|---|
| committer | Minux Ma <minux@golang.org> | 2014-12-24 01:08:06 +0000 |
| commit | cccc3b65d48c95a0e499de2dc77827098edd3d9e (patch) | |
| tree | dd7fa608a8bb5741bf88c099b689f78ed4e4387a /git-codereview/util_test.go | |
| parent | d253e69a2fd1e3da8057dc9b6dcfb08d70495cb8 (diff) | |
| download | go-x-review-cccc3b65d48c95a0e499de2dc77827098edd3d9e.tar.xz | |
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>
Diffstat (limited to 'git-codereview/util_test.go')
| -rw-r--r-- | git-codereview/util_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
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 @@ func newGitTest(t *testing.T) *gitTest { 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 @@ func newGitTest(t *testing.T) *gitTest { 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 |
