aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/error.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-18 19:32:23 -0500
committerUnknwon <u@gogs.io>2015-11-18 19:32:23 -0500
commit2c653141a83eb5bc3fb1baaff0449195b9e1f6a6 (patch)
tree4aab191a53427da0c17a58d42ef01e2f1b28c550 /modules/git/error.go
parentf04d773f4f72f8f167b7ceed4d4e9a6fd4e6ad16 (diff)
downloadgitea-2c653141a83eb5bc3fb1baaff0449195b9e1f6a6.tar.gz
gitea-2c653141a83eb5bc3fb1baaff0449195b9e1f6a6.zip
#1742 Update default branch in git repository while change in web view
Diffstat (limited to 'modules/git/error.go')
-rw-r--r--modules/git/error.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/git/error.go b/modules/git/error.go
new file mode 100644
index 0000000000..c86c56e546
--- /dev/null
+++ b/modules/git/error.go
@@ -0,0 +1,22 @@
+// Copyright 2015 The Gogs 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 git
+
+import (
+ "fmt"
+)
+
+type ErrUnsupportedVersion struct {
+ Required string
+}
+
+func IsErrUnsupportedVersion(err error) bool {
+ _, ok := err.(ErrUnsupportedVersion)
+ return ok
+}
+
+func (err ErrUnsupportedVersion) Error() string {
+ return fmt.Sprintf("Operation requires higher version [required: %s]", err.Required)
+}