summaryrefslogtreecommitdiffstats
path: root/routers/repo/branch.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/branch.go')
-rw-r--r--routers/repo/branch.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go
index df6e0bf21f..88bbe2be56 100644
--- a/routers/repo/branch.go
+++ b/routers/repo/branch.go
@@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/repofiles"
+ repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/util"
"gopkg.in/src-d/go-git.v4/plumbing"
)
@@ -175,7 +176,7 @@ func deleteBranch(ctx *context.Context, branchName string) error {
}
func loadBranches(ctx *context.Context) []*Branch {
- rawBranches, err := ctx.Repo.Repository.GetBranches()
+ rawBranches, err := repo_module.GetBranches(ctx.Repo.Repository)
if err != nil {
ctx.ServerError("GetBranches", err)
return nil
@@ -324,9 +325,9 @@ func CreateBranch(ctx *context.Context, form auth.NewBranchForm) {
var err error
if ctx.Repo.IsViewBranch {
- err = ctx.Repo.Repository.CreateNewBranch(ctx.User, ctx.Repo.BranchName, form.NewBranchName)
+ err = repo_module.CreateNewBranch(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
} else {
- err = ctx.Repo.Repository.CreateNewBranchFromCommit(ctx.User, ctx.Repo.BranchName, form.NewBranchName)
+ err = repo_module.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
}
if err != nil {
if models.IsErrTagAlreadyExists(err) {