4
. "launchpad.net/gocheck"
9
oldValues map[string]string
12
// We ensure that Git is told about the user name and email if the setup under which the
13
// tests are run does not already provide that information. These git env variables are used for
15
var gitEnvVars = []string{
19
"GIT_COMMITTER_EMAIL",
22
func (t *GitSuite) SetUpTest(c *C) {
23
t.oldValues = make(map[string]string)
24
for _, v := range gitEnvVars {
25
t.oldValues[v] = os.Getenv(v)
27
if t.oldValues["GIT_AUTHOR_NAME"] == "" {
28
os.Setenv("GIT_AUTHOR_NAME", "Foo Bar")
30
if t.oldValues["GIT_AUTHOR_EMAIL"] == "" {
31
os.Setenv("GIT_AUTHOR_EMAIL", "foo@example.org")
33
os.Setenv("GIT_COMMITTER_NAME", "$GIT_AUTHOR_NAME")
34
os.Setenv("GIT_COMMITTER_EMAIL", "$GIT_AUTHOR_EMAIL")
37
func (t *GitSuite) TearDownTest(c *C) {
38
for k, v := range t.oldValues {