mirror of
https://github.com/go-gitea/gitea
synced 2025-07-18 00:08:35 +00:00
Refactor legacy git init (#20376)
* merge `CheckLFSVersion` into `InitFull` (renamed from `InitWithSyncOnce`) * remove the `Once` during git init, no data-race now * for doctor sub-commands, `InitFull` should only be called in initialization stage Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
|
||||
git_model "code.gitea.io/gitea/models/git"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/lfs"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
@@ -83,11 +82,6 @@ func checkResponseTestContentEncoding(t *testing.T, content *[]byte, resp *httpt
|
||||
|
||||
func TestGetLFSSmall(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
git.CheckLFSVersion()
|
||||
if !setting.LFS.StartServer {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
content := []byte("A very small file\n")
|
||||
|
||||
resp := storeAndGetLfs(t, &content, nil, http.StatusOK)
|
||||
@@ -96,11 +90,6 @@ func TestGetLFSSmall(t *testing.T) {
|
||||
|
||||
func TestGetLFSLarge(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
git.CheckLFSVersion()
|
||||
if !setting.LFS.StartServer {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
content := make([]byte, web.GzipMinSize*10)
|
||||
for i := range content {
|
||||
content[i] = byte(i % 256)
|
||||
@@ -112,11 +101,6 @@ func TestGetLFSLarge(t *testing.T) {
|
||||
|
||||
func TestGetLFSGzip(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
git.CheckLFSVersion()
|
||||
if !setting.LFS.StartServer {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
b := make([]byte, web.GzipMinSize*10)
|
||||
for i := range b {
|
||||
b[i] = byte(i % 256)
|
||||
@@ -133,11 +117,6 @@ func TestGetLFSGzip(t *testing.T) {
|
||||
|
||||
func TestGetLFSZip(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
git.CheckLFSVersion()
|
||||
if !setting.LFS.StartServer {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
b := make([]byte, web.GzipMinSize*10)
|
||||
for i := range b {
|
||||
b[i] = byte(i % 256)
|
||||
@@ -156,11 +135,6 @@ func TestGetLFSZip(t *testing.T) {
|
||||
|
||||
func TestGetLFSRangeNo(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
git.CheckLFSVersion()
|
||||
if !setting.LFS.StartServer {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
content := []byte("123456789\n")
|
||||
|
||||
resp := storeAndGetLfs(t, &content, nil, http.StatusOK)
|
||||
@@ -169,11 +143,6 @@ func TestGetLFSRangeNo(t *testing.T) {
|
||||
|
||||
func TestGetLFSRange(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
git.CheckLFSVersion()
|
||||
if !setting.LFS.StartServer {
|
||||
t.Skip()
|
||||
return
|
||||
}
|
||||
content := []byte("123456789\n")
|
||||
|
||||
tests := []struct {
|
||||
|
Reference in New Issue
Block a user