mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Move some functions into services/repository (#17677)
This commit is contained in:
parent
750a8465f5
commit
5233051e64
15 changed files with 283 additions and 285 deletions
|
@ -171,7 +171,7 @@ func loadBranches(ctx *context.Context, skip, limit int) ([]*Branch, int) {
|
|||
return nil, 0
|
||||
}
|
||||
|
||||
rawBranches, totalNumOfBranches, err := repo_module.GetBranches(ctx.Repo.Repository, skip, limit)
|
||||
rawBranches, totalNumOfBranches, err := repo_service.GetBranches(ctx.Repo.Repository, skip, limit)
|
||||
if err != nil {
|
||||
log.Error("GetBranches: %v", err)
|
||||
ctx.ServerError("GetBranches", err)
|
||||
|
@ -350,11 +350,11 @@ func CreateBranch(ctx *context.Context) {
|
|||
err = release_service.CreateNewTag(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName, "")
|
||||
}
|
||||
} else if ctx.Repo.IsViewBranch {
|
||||
err = repo_module.CreateNewBranch(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
|
||||
err = repo_service.CreateNewBranch(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
|
||||
} else if ctx.Repo.IsViewTag {
|
||||
err = repo_module.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.CommitID, form.NewBranchName)
|
||||
err = repo_service.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.CommitID, form.NewBranchName)
|
||||
} else {
|
||||
err = repo_module.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
|
||||
err = repo_service.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
|
||||
}
|
||||
if err != nil {
|
||||
if models.IsErrTagAlreadyExists(err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue