aboutsummaryrefslogtreecommitdiff
path: root/cmd
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 /cmd
parent51e087fd8731137c969f616bc90f383a2c2bff27 (diff)
models: move ErrBranchNotExist to errors package
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hook.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/hook.go b/cmd/hook.go
index dd5a4f23..8533e3b1 100644
--- a/cmd/hook.go
+++ b/cmd/hook.go
@@ -22,6 +22,7 @@ import (
"github.com/gogits/git-module"
"github.com/gogits/gogs/models"
+ "github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/httplib"
"github.com/gogits/gogs/pkg/mailer"
"github.com/gogits/gogs/pkg/setting"
@@ -94,7 +95,7 @@ func runHookPreReceive(c *cli.Context) error {
repoID := com.StrTo(os.Getenv(http.ENV_REPO_ID)).MustInt64()
protectBranch, err := models.GetProtectBranchOfRepoByName(repoID, branchName)
if err != nil {
- if models.IsErrBranchNotExist(err) {
+ if errors.IsErrBranchNotExist(err) {
continue
}
fail("Internal error", "GetProtectBranchOfRepoByName [repo_id: %d, branch: %s]: %v", repoID, branchName, err)