summaryrefslogtreecommitdiffstats
path: root/modules/markup
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-05-04 11:55:35 +0800
committerGitHub <noreply@github.com>2023-05-04 11:55:35 +0800
commit377a0a20f01a62f15a1504a3bba6cf6cc0c98bea (patch)
treee86a1818f23be1605a4cd707fadc7dcdce546d18 /modules/markup
parenta2fe68e50ba819daed9b0e28166a749d18c58750 (diff)
downloadgitea-377a0a20f01a62f15a1504a3bba6cf6cc0c98bea.tar.gz
gitea-377a0a20f01a62f15a1504a3bba6cf6cc0c98bea.zip
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.
Diffstat (limited to 'modules/markup')
-rw-r--r--modules/markup/html_test.go5
-rw-r--r--modules/markup/markdown/markdown_test.go5
2 files changed, 6 insertions, 4 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go
index cb1216ec94..5e5e4fecbb 100644
--- a/modules/markup/html_test.go
+++ b/modules/markup/html_test.go
@@ -28,8 +28,9 @@ var localMetas = map[string]string{
}
func TestMain(m *testing.M) {
- setting.InitProviderAllowEmpty()
- setting.LoadCommonSettings()
+ setting.Init(&setting.Options{
+ AllowEmpty: true,
+ })
if err := git.InitSimple(context.Background()); err != nil {
log.Fatal("git init failed, err: %v", err)
}
diff --git a/modules/markup/markdown/markdown_test.go b/modules/markup/markdown/markdown_test.go
index 0c7650a5ff..e81869d7a4 100644
--- a/modules/markup/markdown/markdown_test.go
+++ b/modules/markup/markdown/markdown_test.go
@@ -33,8 +33,9 @@ var localMetas = map[string]string{
}
func TestMain(m *testing.M) {
- setting.InitProviderAllowEmpty()
- setting.LoadCommonSettings()
+ setting.Init(&setting.Options{
+ AllowEmpty: true,
+ })
if err := git.InitSimple(context.Background()); err != nil {
log.Fatal("git init failed, err: %v", err)
}