mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Merge setting.InitXXX into one function with options (#24389)
This PR will merge 3 Init functions on setting packages as 1 and introduce an options struct.
This commit is contained in:
@@ -57,7 +57,7 @@ func initMigrationTest(t *testing.T) func() {
|
||||
setting.CustomConf = giteaConf
|
||||
}
|
||||
|
||||
setting.InitProviderAndLoadCommonSettingsForTest()
|
||||
unittest.InitSettings()
|
||||
|
||||
assert.True(t, len(setting.RepoRootPath) != 0)
|
||||
assert.NoError(t, util.RemoveAll(setting.RepoRootPath))
|
||||
|
@@ -74,7 +74,7 @@ func InitTest(requireGitea bool) {
|
||||
}
|
||||
|
||||
setting.SetCustomPathAndConf("", "", "")
|
||||
setting.InitProviderAndLoadCommonSettingsForTest()
|
||||
unittest.InitSettings()
|
||||
setting.Repository.DefaultBranch = "master" // many test code still assume that default branch is called "master"
|
||||
_ = util.RemoveAll(repo_module.LocalCopyPath())
|
||||
|
||||
|
Reference in New Issue
Block a user