mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 18:17:19 +00:00
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>
This commit is contained in:
@ -5,12 +5,14 @@
|
||||
package markup_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/emoji"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
. "code.gitea.io/gitea/modules/markup"
|
||||
"code.gitea.io/gitea/modules/markup/markdown"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
@ -25,6 +27,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_Commits(t *testing.T) {
|
||||
setting.AppURL = TestAppURL
|
||||
test := func(input, expected string) {
|
||||
|
Reference in New Issue
Block a user