diff options
Diffstat (limited to 'internal/testgit/repo_new.go')
| -rw-r--r-- | internal/testgit/repo_new.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/internal/testgit/repo_new.go b/internal/testgit/repo_new.go index 8a71e406..4ae80393 100644 --- a/internal/testgit/repo_new.go +++ b/internal/testgit/repo_new.go @@ -32,16 +32,7 @@ func NewRepo(tb testing.TB, opts RepoOptions) *TestRepo { testRepo := &TestRepo{ dir: dir, algo: algo, - env: append(os.Environ(), - "GIT_CONFIG_GLOBAL=/dev/null", - "GIT_CONFIG_SYSTEM=/dev/null", - "GIT_AUTHOR_NAME=Test Author", - "GIT_AUTHOR_EMAIL=test@example.org", - "GIT_COMMITTER_NAME=Test Committer", - "GIT_COMMITTER_EMAIL=committer@example.org", - "GIT_AUTHOR_DATE=1234567890 +0000", - "GIT_COMMITTER_DATE=1234567890 +0000", - ), + env: defaultEnv(), } args := []string{"init", "--object-format=" + algo.String()} @@ -58,3 +49,16 @@ func NewRepo(tb testing.TB, opts RepoOptions) *TestRepo { return testRepo } + +func defaultEnv() []string { + return append(os.Environ(), + "GIT_CONFIG_GLOBAL=/dev/null", + "GIT_CONFIG_SYSTEM=/dev/null", + "GIT_AUTHOR_NAME=Test Author", + "GIT_AUTHOR_EMAIL=test@example.org", + "GIT_COMMITTER_NAME=Test Committer", + "GIT_COMMITTER_EMAIL=committer@example.org", + "GIT_AUTHOR_DATE=1234567890 +0000", + "GIT_COMMITTER_DATE=1234567890 +0000", + ) +} |
