summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/branch.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/branch.go')
-rw-r--r--routers/api/v1/repo/branch.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go
index afc4763b52..8f8ca15877 100644
--- a/routers/api/v1/repo/branch.go
+++ b/routers/api/v1/repo/branch.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/convert"
"code.gitea.io/gitea/modules/git"
+ repo_module "code.gitea.io/gitea/modules/repository"
api "code.gitea.io/gitea/modules/structs"
)
@@ -48,7 +49,7 @@ func GetBranch(ctx *context.APIContext) {
ctx.NotFound()
return
}
- branch, err := ctx.Repo.Repository.GetBranch(ctx.Repo.BranchName)
+ branch, err := repo_module.GetBranch(ctx.Repo.Repository, ctx.Repo.BranchName)
if err != nil {
if git.IsErrBranchNotExist(err) {
ctx.NotFound(err)
@@ -95,7 +96,7 @@ func ListBranches(ctx *context.APIContext) {
// "200":
// "$ref": "#/responses/BranchList"
- branches, err := ctx.Repo.Repository.GetBranches()
+ branches, err := repo_module.GetBranches(ctx.Repo.Repository)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetBranches", err)
return