diff options
author | Unknwon <u@gogs.io> | 2016-08-15 05:53:47 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-15 05:53:47 -0700 |
commit | 94392a7af3d07f79adab195acfb7c1b545f68be9 (patch) | |
tree | 7782b7b0ca87f3ca077c98b945892ec833e3b25e /models | |
parent | cc647ba9d5854319df259377f0c89027bb9f9813 (diff) | |
download | gitea-94392a7af3d07f79adab195acfb7c1b545f68be9.tar.gz gitea-94392a7af3d07f79adab195acfb7c1b545f68be9.zip |
Fix empty repository panic on send test webhook
Diffstat (limited to 'models')
-rw-r--r-- | models/action.go | 5 | ||||
-rw-r--r-- | models/issue.go | 18 |
2 files changed, 2 insertions, 21 deletions
diff --git a/models/action.go b/models/action.go index c727c05992..13085ace71 100644 --- a/models/action.go +++ b/models/action.go @@ -6,7 +6,6 @@ package models import ( "encoding/json" - "errors" "fmt" "path" "regexp" @@ -46,10 +45,6 @@ const ( ) var ( - ErrNotImplemented = errors.New("Not implemented yet") -) - -var ( // Same as Github. See https://help.github.com/articles/closing-issues-via-commit-messages IssueCloseKeywords = []string{"close", "closes", "closed", "fix", "fixes", "fixed", "resolve", "resolves", "resolved"} IssueReopenKeywords = []string{"reopen", "reopens", "reopened"} diff --git a/models/issue.go b/models/issue.go index eb126325f0..541b70068d 100644 --- a/models/issue.go +++ b/models/issue.go @@ -25,9 +25,8 @@ import ( ) var ( - ErrWrongIssueCounter = errors.New("Invalid number of issues for this milestone") - ErrAttachmentNotLinked = errors.New("Attachment does not belong to this issue") - ErrMissingIssueNumber = errors.New("No issue number specified") + ErrWrongIssueCounter = errors.New("Invalid number of issues for this milestone") + ErrMissingIssueNumber = errors.New("No issue number specified") ) // Issue represents an issue or pull request of repository. @@ -834,19 +833,6 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) { return issues, sess.Find(&issues) } -type IssueStatus int - -const ( - IS_OPEN = iota + 1 - IS_CLOSE -) - -// GetIssueCountByPoster returns number of issues of repository by poster. -func GetIssueCountByPoster(uid, rid int64, isClosed bool) int64 { - count, _ := x.Where("repo_id=?", rid).And("poster_id=?", uid).And("is_closed=?", isClosed).Count(new(Issue)) - return count -} - // .___ ____ ___ // | | ______ ________ __ ____ | | \______ ___________ // | |/ ___// ___/ | \_/ __ \| | / ___// __ \_ __ \ |