Ignore invalid issue numbers in commit messages. Fixes #2022 (#2150)

This commit is contained in:
Lauris BH
2017-07-13 06:35:47 +03:00
committed by Bo-Yi Wu
parent 7d61834dc9
commit b639fa1648
3 changed files with 6 additions and 5 deletions

View File

@ -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])