mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Move some functions into services/repository (#17677)
This commit is contained in:
		@@ -13,9 +13,9 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
	"code.gitea.io/gitea/models/unittest"
 | 
			
		||||
	"code.gitea.io/gitea/modules/git"
 | 
			
		||||
	repo_module "code.gitea.io/gitea/modules/repository"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
	api "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
	repo_service "code.gitea.io/gitea/services/repository"
 | 
			
		||||
 | 
			
		||||
	"github.com/stretchr/testify/assert"
 | 
			
		||||
)
 | 
			
		||||
@@ -72,7 +72,7 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
 | 
			
		||||
 | 
			
		||||
	// Make a new branch in repo1
 | 
			
		||||
	newBranch := "test_branch"
 | 
			
		||||
	err := repo_module.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
 | 
			
		||||
	err := repo_service.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
 | 
			
		||||
	assert.NoError(t, err)
 | 
			
		||||
	// Get the commit ID of the default branch
 | 
			
		||||
	gitRepo, err := git.OpenRepository(repo1.RepoPath())
 | 
			
		||||
 
 | 
			
		||||
@@ -12,9 +12,9 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/models"
 | 
			
		||||
	"code.gitea.io/gitea/models/unittest"
 | 
			
		||||
	"code.gitea.io/gitea/modules/git"
 | 
			
		||||
	repo_module "code.gitea.io/gitea/modules/repository"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
	api "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
	repo_service "code.gitea.io/gitea/services/repository"
 | 
			
		||||
 | 
			
		||||
	"github.com/stretchr/testify/assert"
 | 
			
		||||
)
 | 
			
		||||
@@ -73,7 +73,7 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
 | 
			
		||||
 | 
			
		||||
	// Make a new branch in repo1
 | 
			
		||||
	newBranch := "test_branch"
 | 
			
		||||
	err := repo_module.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
 | 
			
		||||
	err := repo_service.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
 | 
			
		||||
	assert.NoError(t, err)
 | 
			
		||||
	// Get the commit ID of the default branch
 | 
			
		||||
	gitRepo, err := git.OpenRepository(repo1.RepoPath())
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user