1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Move some functions into services/repository (#17677)

This commit is contained in:
Lunny Xiao
2021-11-17 23:17:31 +08:00
committed by GitHub
parent 750a8465f5
commit 5233051e64
15 changed files with 283 additions and 285 deletions

View File

@@ -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