From 9d728618a82685813a766413f193c11e7ae619d1 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 9 Apr 2022 11:16:26 +0800 Subject: [PATCH] fix test code --- integrations/integration_test.go | 1 + models/unittest/testdb.go | 1 + 2 files changed, 2 insertions(+) diff --git a/integrations/integration_test.go b/integrations/integration_test.go index e7ceb33e96bff..8d2bfe9383f9c 100644 --- a/integrations/integration_test.go +++ b/integrations/integration_test.go @@ -165,6 +165,7 @@ func initIntegrationTest() { setting.SetCustomPathAndConf("", "", "") setting.LoadForTest() + setting.Repository.DefaultBranch = "master" // many test code still assume that default branch is called "master" _ = util.RemoveAll(models.LocalCopyPath()) git.CheckLFSVersion() setting.InitDBConfig() diff --git a/models/unittest/testdb.go b/models/unittest/testdb.go index b6924d4706808..4f1bd63f29a70 100644 --- a/models/unittest/testdb.go +++ b/models/unittest/testdb.go @@ -69,6 +69,7 @@ func MainTest(m *testing.M, pathToGiteaRoot string, fixtureFiles ...string) { setting.SSH.Port = 3000 setting.SSH.Domain = "try.gitea.io" setting.Database.UseSQLite3 = true + setting.Repository.DefaultBranch = "master" // many test code still assume that default branch is called "master" repoRootPath, err := os.MkdirTemp(os.TempDir(), "repos") if err != nil { fatalTestError("TempDir: %v\n", err)