forked from kevadesu/forgejo
Refactor env var related code (#33075)
And add more comments (cherry picked from commit 4f386e2c5e39b860424faf4cbc02c16f641f956e) Conflicts: cmd/main_test.go tests/integration/integration_test.go trivial context conflicts
This commit is contained in:
parent
6208d5f5c2
commit
e507fa30df
5 changed files with 32 additions and 52 deletions
|
@ -40,13 +40,6 @@ func TestMain(m *testing.M) {
|
|||
initChangedFiles()
|
||||
testE2eWebRoutes = routers.NormalRoutes()
|
||||
|
||||
os.Unsetenv("GIT_AUTHOR_NAME")
|
||||
os.Unsetenv("GIT_AUTHOR_EMAIL")
|
||||
os.Unsetenv("GIT_AUTHOR_DATE")
|
||||
os.Unsetenv("GIT_COMMITTER_NAME")
|
||||
os.Unsetenv("GIT_COMMITTER_EMAIL")
|
||||
os.Unsetenv("GIT_COMMITTER_DATE")
|
||||
|
||||
err := unittest.InitFixtures(
|
||||
unittest.FixturesOptions{
|
||||
Dir: filepath.Join(setting.AppWorkPath, "models/fixtures/"),
|
||||
|
|
|
@ -159,18 +159,6 @@ func TestMain(m *testing.M) {
|
|||
}
|
||||
}
|
||||
|
||||
os.Unsetenv("GIT_AUTHOR_NAME")
|
||||
os.Unsetenv("GIT_AUTHOR_EMAIL")
|
||||
os.Unsetenv("GIT_AUTHOR_DATE")
|
||||
os.Unsetenv("GIT_COMMITTER_NAME")
|
||||
os.Unsetenv("GIT_COMMITTER_EMAIL")
|
||||
os.Unsetenv("GIT_COMMITTER_DATE")
|
||||
|
||||
// Avoid loading the default system config. On MacOS, this config
|
||||
// sets the osxkeychain credential helper, which will cause tests
|
||||
// to freeze with a dialog.
|
||||
os.Setenv("GIT_CONFIG_NOSYSTEM", "true")
|
||||
|
||||
err := unittest.InitFixtures(
|
||||
unittest.FixturesOptions{
|
||||
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue