mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Move some functions into services/repository (#17677)
This commit is contained in:
		@@ -176,7 +176,7 @@ func CreateBranch(ctx *context.APIContext) {
 | 
			
		||||
		opt.OldBranchName = ctx.Repo.Repository.DefaultBranch
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err := repo_module.CreateNewBranch(ctx.User, ctx.Repo.Repository, opt.OldBranchName, opt.BranchName)
 | 
			
		||||
	err := repo_service.CreateNewBranch(ctx.User, ctx.Repo.Repository, opt.OldBranchName, opt.BranchName)
 | 
			
		||||
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if models.IsErrBranchDoesNotExist(err) {
 | 
			
		||||
@@ -257,7 +257,7 @@ func ListBranches(ctx *context.APIContext) {
 | 
			
		||||
 | 
			
		||||
	listOptions := utils.GetListOptions(ctx)
 | 
			
		||||
	skip, _ := listOptions.GetStartEnd()
 | 
			
		||||
	branches, totalNumOfBranches, err := repo_module.GetBranches(ctx.Repo.Repository, skip, listOptions.PageSize)
 | 
			
		||||
	branches, totalNumOfBranches, err := repo_service.GetBranches(ctx.Repo.Repository, skip, listOptions.PageSize)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ctx.Error(http.StatusInternalServerError, "GetBranches", err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user