summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/convert/convert.go2
-rw-r--r--routers/api/v1/repo/branch.go5
2 files changed, 4 insertions, 3 deletions
diff --git a/routers/api/v1/convert/convert.go b/routers/api/v1/convert/convert.go
index aca21db4ed..f132dedb55 100644
--- a/routers/api/v1/convert/convert.go
+++ b/routers/api/v1/convert/convert.go
@@ -27,7 +27,7 @@ func ToEmail(email *models.EmailAddress) *api.Email {
}
// ToBranch convert a commit and branch to an api.Branch
-func ToBranch(repo *models.Repository, b *models.Branch, c *git.Commit) *api.Branch {
+func ToBranch(repo *models.Repository, b *git.Branch, c *git.Commit) *api.Branch {
return &api.Branch{
Name: b.Name,
Commit: ToCommit(repo, c),
diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go
index e20eef6139..b9a23d3b51 100644
--- a/routers/api/v1/repo/branch.go
+++ b/routers/api/v1/repo/branch.go
@@ -1,12 +1,13 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
+// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package repo
import (
- "code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/routers/api/v1/convert"
api "code.gitea.io/sdk/gitea"
@@ -47,7 +48,7 @@ func GetBranch(ctx *context.APIContext) {
}
branch, err := ctx.Repo.Repository.GetBranch(ctx.Repo.BranchName)
if err != nil {
- if models.IsErrBranchNotExist(err) {
+ if git.IsErrBranchNotExist(err) {
ctx.NotFound(err)
} else {
ctx.Error(500, "GetBranch", err)