summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-07-13 06:35:47 +0300
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-07-12 22:35:47 -0500
commitb639fa16481cdd32f491a8267fc83a5a472f9093 (patch)
tree4fcbc9187df281600b815e1b3e61b420e131aab4 /models/issue.go
parent7d61834dc983d799acf9aea795b78c6285f363c3 (diff)
downloadgitea-b639fa16481cdd32f491a8267fc83a5a472f9093.tar.gz
gitea-b639fa16481cdd32f491a8267fc83a5a472f9093.zip
Ignore invalid issue numbers in commit messages. Fixes #2022 (#2150)
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index db05a7d45c..a8dfb3233f 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -24,6 +24,7 @@ import (
var (
errMissingIssueNumber = errors.New("No issue number specified")
+ errInvalidIssueNumber = errors.New("Invalid issue number")
)
// Issue represents an issue or pull request of repository.
@@ -961,7 +962,7 @@ func GetIssueByRef(ref string) (*Issue, error) {
index, err := com.StrTo(ref[n+1:]).Int64()
if err != nil {
- return nil, err
+ return nil, errInvalidIssueNumber
}
repo, err := GetRepositoryByRef(ref[:n])