From 377a0a20f01a62f15a1504a3bba6cf6cc0c98bea Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 4 May 2023 11:55:35 +0800 Subject: 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. --- modules/markup/html_test.go | 5 +++-- modules/markup/markdown/markdown_test.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'modules/markup') 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) } -- cgit v1.2.3