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.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go
index 56266b406a..c5480bf2c5 100644
--- a/routers/api/v1/repo/branch.go
+++ b/routers/api/v1/repo/branch.go
@@ -53,7 +53,7 @@ func GetBranch(ctx *context.APIContext) {
branchName := ctx.Params("*")
- branch, err := repo_service.GetBranch(ctx.Repo.Repository, branchName)
+ branch, err := ctx.Repo.GitRepo.GetBranch(branchName)
if err != nil {
if git.IsErrBranchNotExist(err) {
ctx.NotFound(err)
@@ -176,7 +176,7 @@ func CreateBranch(ctx *context.APIContext) {
opt.OldBranchName = ctx.Repo.Repository.DefaultBranch
}
- err := repo_service.CreateNewBranch(ctx.User, ctx.Repo.Repository, opt.OldBranchName, opt.BranchName)
+ err := repo_service.CreateNewBranch(ctx, ctx.User, ctx.Repo.Repository, opt.OldBranchName, opt.BranchName)
if err != nil {
if models.IsErrBranchDoesNotExist(err) {
@@ -198,7 +198,7 @@ func CreateBranch(ctx *context.APIContext) {
return
}
- branch, err := repo_service.GetBranch(ctx.Repo.Repository, opt.BranchName)
+ branch, err := ctx.Repo.GitRepo.GetBranch(opt.BranchName)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetBranch", err)
return
@@ -257,7 +257,7 @@ func ListBranches(ctx *context.APIContext) {
listOptions := utils.GetListOptions(ctx)
skip, _ := listOptions.GetStartEnd()
- branches, totalNumOfBranches, err := repo_service.GetBranches(ctx.Repo.Repository, skip, listOptions.PageSize)
+ branches, totalNumOfBranches, err := ctx.Repo.GitRepo.GetBranches(skip, listOptions.PageSize)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetBranches", err)
return