aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-03-08 07:15:55 -0500
committerUnknwon <u@gogs.io>2018-03-08 07:15:55 -0500
commit1f7983059aa80307a86c19088decaedfeb019755 (patch)
treef47209b37efbd5cbb585e2ea66f24fa5af14a06a /routes
parent51e087fd8731137c969f616bc90f383a2c2bff27 (diff)
models: move ErrBranchNotExist to errors package
Diffstat (limited to 'routes')
-rw-r--r--routes/api/v1/repo/branch.go4
-rw-r--r--routes/repo/setting.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/routes/api/v1/repo/branch.go b/routes/api/v1/repo/branch.go
index d8c2697b..3e001478 100644
--- a/routes/api/v1/repo/branch.go
+++ b/routes/api/v1/repo/branch.go
@@ -7,7 +7,7 @@ package repo
import (
api "github.com/gogits/go-gogs-client"
- "github.com/gogits/gogs/models"
+ "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/routes/api/v1/convert"
)
@@ -16,7 +16,7 @@ import (
func GetBranch(c *context.APIContext) {
branch, err := c.Repo.Repository.GetBranch(c.Params("*"))
if err != nil {
- if models.IsErrBranchNotExist(err) {
+ if errors.IsErrBranchNotExist(err) {
c.Error(404, "GetBranch", err)
} else {
c.Error(500, "GetBranch", err)
diff --git a/routes/repo/setting.go b/routes/repo/setting.go
index 61c8f311..ce96cf24 100644
--- a/routes/repo/setting.go
+++ b/routes/repo/setting.go
@@ -433,7 +433,7 @@ func SettingsProtectedBranch(c *context.Context) {
protectBranch, err := models.GetProtectBranchOfRepoByName(c.Repo.Repository.ID, branch)
if err != nil {
- if !models.IsErrBranchNotExist(err) {
+ if !errors.IsErrBranchNotExist(err) {
c.Handle(500, "GetProtectBranchOfRepoByName", err)
return
}
@@ -475,7 +475,7 @@ func SettingsProtectedBranchPost(c *context.Context, f form.ProtectBranch) {
protectBranch, err := models.GetProtectBranchOfRepoByName(c.Repo.Repository.ID, branch)
if err != nil {
- if !models.IsErrBranchNotExist(err) {
+ if !errors.IsErrBranchNotExist(err) {
c.Handle(500, "GetProtectBranchOfRepoByName", err)
return
}