(gitConf *git.Configuration, osEnv, gitEnv map[string]string)
| 23 | } |
| 24 | |
| 25 | func NewContext(gitConf *git.Configuration, osEnv, gitEnv map[string]string) Context { |
| 26 | c := &testContext{gitConfig: gitConf} |
| 27 | if c.gitConfig == nil { |
| 28 | c.gitConfig = git.NewConfig("", "") |
| 29 | } |
| 30 | if osEnv != nil { |
| 31 | c.osEnv = testEnv(osEnv) |
| 32 | } else { |
| 33 | c.osEnv = make(testEnv) |
| 34 | } |
| 35 | |
| 36 | if gitEnv != nil { |
| 37 | c.gitEnv = testEnv(gitEnv) |
| 38 | } else { |
| 39 | c.gitEnv = make(testEnv) |
| 40 | } |
| 41 | return c |
| 42 | } |
| 43 | |
| 44 | type testContext struct { |
| 45 | gitConfig *git.Configuration |