diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-06-16 23:47:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 23:47:44 +0800 |
commit | 157b4057531b99b2d3b5c086f385c830aa38354f (patch) | |
tree | 5a7f066be290cefe174b7f5ab5f48f478921a226 /modules/markup/markdown/markdown_test.go | |
parent | 70ce051f1a7e266dccdd7cfd42f88a2570448770 (diff) | |
download | gitea-157b4057531b99b2d3b5c086f385c830aa38354f.tar.gz gitea-157b4057531b99b2d3b5c086f385c830aa38354f.zip |
Remove legacy git code (ver < 2.0), fine tune markup tests (#19930)
* clean git support for ver < 2.0
* fine tune tests for markup (which requires git module)
* remove unnecessary comments
* try to fix tests
* try test again
* use const for GitVersionRequired instead of var
* try to fix integration test
* Refactor CheckAttributeReader to make a *git.Repository version
* update document for commit signing with Gitea's internal gitconfig
* update document for commit signing with Gitea's internal gitconfig
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/markup/markdown/markdown_test.go')
-rw-r--r-- | modules/markup/markdown/markdown_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/markup/markdown/markdown_test.go b/modules/markup/markdown/markdown_test.go index a069d402bb..732fe1a6be 100644 --- a/modules/markup/markdown/markdown_test.go +++ b/modules/markup/markdown/markdown_test.go @@ -5,6 +5,7 @@ package markdown_test import ( + "context" "strings" "testing" @@ -31,6 +32,13 @@ var localMetas = map[string]string{ "repoPath": "../../../integrations/gitea-repositories-meta/user13/repo11.git/", } +func TestMain(m *testing.M) { + setting.LoadAllowEmpty() + if err := git.InitSimple(context.Background()); err != nil { + log.Fatal("git init failed, err: %v", err) + } +} + func TestRender_StandardLinks(t *testing.T) { setting.AppURL = AppURL setting.AppSubURL = AppSubURL |