mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
* fix pr count error * fix tests
This commit is contained in:
@@ -1835,3 +1835,22 @@ func (issue *Issue) BlockedByDependencies() ([]*Issue, error) {
|
||||
func (issue *Issue) BlockingDependencies() ([]*Issue, error) {
|
||||
return issue.getBlockingDependencies(x)
|
||||
}
|
||||
|
||||
func (issue *Issue) updateClosedNum(e Engine) (err error) {
|
||||
if issue.IsPull {
|
||||
_, err = e.Exec("UPDATE `repository` SET num_closed_pulls=(SELECT count(*) FROM issue WHERE repo_id=? AND is_pull=? AND is_closed=?) WHERE id=?",
|
||||
issue.RepoID,
|
||||
true,
|
||||
true,
|
||||
issue.RepoID,
|
||||
)
|
||||
} else {
|
||||
_, err = e.Exec("UPDATE `repository` SET num_closed_issues=(SELECT count(*) FROM issue WHERE repo_id=? AND is_pull=? AND is_closed=?) WHERE id=?",
|
||||
issue.RepoID,
|
||||
false,
|
||||
true,
|
||||
issue.RepoID,
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user