Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Fixes indexed repos keeping outdated indexes when files grow too large #7730

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f481867
Fix migration tests since #7 fixed (#7375) (#7381)
lunny Jul 8, 2019
f849766
backport of #7380 (#7383)
Cherrg Jul 8, 2019
1e585d7
backport of #7385 - add missing template variable on organisation set…
Cherrg Jul 8, 2019
82d4d72
only return head: null if source branch was deleted (#6705) (#7376)
quantonganh Jul 9, 2019
a360dae
Fix vendor (#7394) (#7396)
lunny Jul 9, 2019
2477737
Only show "New Pull Request" button if repo allows pulls (#7426) (#7432)
gary-kim Jul 12, 2019
60ccd87
backport #7425 - jquery 3 (#7442)
techknowlogick Jul 12, 2019
97d4a38
Diff: Fix indentation on unhighlighted code (#7435) (#7443)
silverwind Jul 12, 2019
f528406
backport of #7393 - create class for inline positioned lists (#7439)
Cherrg Jul 12, 2019
cc8e7dd
fix Dropzone.js integration (#7445) (#7448)
silverwind Jul 12, 2019
ba19a35
Fix an issue with some pages throwing 'not defined' js exceptions #74…
gary-kim Jul 13, 2019
ee1a8d7
cmd/serv: actually exit after fatal errors (#7460)
aswild Jul 14, 2019
b45f926
Fix regex for issues in commit messages (#7444) (#7466)
mrsdizzie Jul 14, 2019
33b1027
1.9.0-rc2 changelog (#7467)
techknowlogick Jul 15, 2019
92b993c
Fetch refs for successful testing for tag (#7388)
techknowlogick Jul 15, 2019
a29e667
Backport for #7475 - settings error (#7483)
richmahn Jul 16, 2019
91e24a3
Fixes #7474 - Handles all redirects for Web UI File CRUD (#7478) (#7507)
richmahn Jul 18, 2019
d372539
Backport drone fix from #7480 and #7496 (#7504)
sapk Jul 18, 2019
3fd07a0
remove duplicated webhook trigger (#7511) (#7516)
lunny Jul 18, 2019
5ebf499
Fix repository's pull request count error (#7518) (#7524)
lunny Jul 19, 2019
337f262
Fix markdown invoke sequence (#7513) (#7560)
lunny Jul 22, 2019
426fd2a
Fix empty commits now showing in repo overview (#7521) (#7563)
silverwind Jul 22, 2019
103a66a
Fixes #7564 - Malformed URLs in API git/commits response (#7565) (#7567)
richmahn Jul 22, 2019
d6a9805
Fix file header overflow in file and blame views (#7562) (#7579)
silverwind Jul 23, 2019
adb4335
fix #7568 (#7587) (#7589)
zeripath Jul 23, 2019
5a3d986
Handle ErrUserProhibitLogin in http git (#7586, #7591) (#7590)
zeripath Jul 23, 2019
b7e41f7
Fix panic on push at #7611 (#7615) (#7618)
zeripath Jul 25, 2019
4c69e15
Fix bug create/edit wiki pages when code master branch protected (#75…
lunny Jul 26, 2019
650fdce
Fix syntax highlight initialization (#7617) (#7626)
silverwind Jul 26, 2019
9bbe3eb
reserve .well-known username (#7638)
ashimokawa Jul 26, 2019
d789170
fix wrong email when use gitea as OAuth2 provider (#7640) (#7647)
renothing Jul 27, 2019
d827b0b
change length of some repository's columns (#7652) (#7655)
lunny Jul 29, 2019
1e6d2e4
css: use flex to fix floating paginate (#7656) (#7662)
sapk Jul 29, 2019
d4044b9
fix bug on migrating milestone from github (#7665) (#7666)
lunny Jul 29, 2019
0a9794a
hide delete/restore button on archived repos [backport] (#7660)
6543 Jul 29, 2019
9fbb898
Show protection symbol if needed on default branch (#7660) (#7668)
6543 Jul 30, 2019
93bac4e
Backport of #7675. (#7682)
davidsvantesson Jul 31, 2019
99ffd82
upgrade macaron/captcha to fix random error problem (#7407) (#7683)
lunny Jul 31, 2019
ee43d20
fix duplicated webhook when creating issue with assignees (#7681) (#7…
lunny Jul 31, 2019
8f29011
1.9.0 Changelog (#7676)
techknowlogick Jul 31, 2019
39da4ac
Correct wrong datetime format for git (#7689) (#7690)
zeripath Jul 31, 2019
d15e49f
improve branches list performance and fix protected branch icon when …
lunny Aug 1, 2019
6d441de
Backport: skip non-regular files (e.g. submodules) on repo indexing (…
guillep2k Aug 2, 2019
6093e82
Fixes indexed repos keeping outdated indexes when files grow too large
Aug 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 29 additions & 38 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ steps:
- push
- pull_request

- name: tag-pre-condition
pull: always
image: alpine/git
commands:
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
depends_on:
- build
when:
event:
- tag

- name: tag-test
pull: always
image: golang:1.12
Expand All @@ -122,7 +133,7 @@ steps:
environment:
TAGS: bindata
depends_on:
- build
- tag-pre-condition
when:
event:
- tag
Expand Down Expand Up @@ -442,7 +453,6 @@ trigger:

depends_on:
- testing
- translations

steps:
- name: fetch-tags
Expand Down Expand Up @@ -558,6 +568,15 @@ workspace:
base: /go
path: src/code.gitea.io/gitea

depends_on:
- testing

trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"

steps:
- name: fetch-tags
pull: default
Expand All @@ -571,56 +590,28 @@ steps:

- name: dryrun
pull: always
image: plugins/docker:18.09
image: plugins/docker:linux-amd64
settings:
cache_from: gitea/gitea
dry_run: true
repo: gitea/gitea
when:
event:
- pull_request

- name: release
- name: publish
pull: always
image: plugins/docker:18.09
image: plugins/docker:linux-amd64
settings:
cache_from: gitea/gitea
auto_tag: true
repo: gitea/gitea
tags:
- "${DRONE_BRANCH##release/v}"
environment:
DOCKER_PASSWORD:
password:
from_secret: docker_password
DOCKER_USERNAME:
username:
from_secret: docker_username
depends_on:
- dryrun
when:
branch:
- "release/*"
event:
- push

- name: latest
pull: always
image: plugins/docker:18.09
settings:
cache_from: gitea/gitea
default_tags: true
repo: gitea/gitea
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
depends_on:
- dryrun
when:
branch:
- master
event:
- push
- tag
exclude:
- pull_request

---
kind: pipeline
Expand Down
44 changes: 41 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).

## [1.9.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.9.0-rc1) - 2019-07-06
## [1.9.0](https://github.com/go-gitea/gitea/releases/tag/v1.9.0) - 2019-07-30
* BREAKING
* Better logging (#6038) (#6095)
* SECURITY
* Shadow the password on cache and session config on admin panel (#7300)
* Fix markdown invoke sequence (#7513) (#7560)
* Reserve .well-known username (#7638)
* Do not leak secrets via timing side channel (#7364)
* Ensure that decryption of cookie actually suceeds (#7363)
* FEATURE
* Content API for Creating, Updating, Deleting Files (#6314)
* Enable tls-alpn-01: Use certmanager provided TLSConfig for LetsEncrypt (#7229)
Expand All @@ -29,6 +35,39 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* Implement Default Webhooks (#4299)
* Telegram webhook (#4227)
* BUGFIXES
* Send webhook after commit when creating issue with assignees (#7681) (#7684)
* Upgrade macaron/captcha to fix random error problem (#7407) (#7683)
* Move add to hook queue for created repo to outside xorm session. (#7682) (#7675)
* Show protection symbol if needed on default branch (#7660) (#7668)
* Hide delete/restore button on archived repos (#7660)
* Fix bug on migrating milestone from github (#7665) (#7666)
* Use flex to fix floating paginate (#7656) (#7662)
* Change length of some repository's columns (#7652) (#7655)
* Fix wrong email when use gitea as OAuth2 provider (#7640) (#7647)
* Fix syntax highlight initialization (#7617) (#7626)
* Fix bug create/edit wiki pages when code master branch protected (#7580) (#7623)
* Fix panic on push at #7611 (#7615) (#7618)
* Handle ErrUserProhibitLogin in http git (#7586, #7591) (#7590)
* Fix color of split-diff view in dark theme (#7587) (#7589)
* Fix file header overflow in file and blame views (#7562) (#7579)
* Malformed URLs in API git/commits response (#7565) (#7567)
* Fix empty commits now showing in repo overview (#7521) (#7563)
* Fix repository's pull request count error (#7518) (#7524)
* Remove duplicated webhook trigger (#7511) (#7516)
* Handles all redirects for Web UI File CRUD (#7478) (#7507)
* Fix regex for issues in commit messages (#7444) (#7466)
* cmd/serv: actually exit after fatal errors (#7458) (#7460)
* Fix an issue with some pages throwing 'not defined' js exceptions #7450 (#7453)
* Fix Dropzone.js integration (#7445) (#7448)
* Create class for inline positioned lists (#7439) (#7393)
* Diff: Fix indentation on unhighlighted code (#7435) (#7443)
* jQuery 3 (#7442) (#7425)
* Only show "New Pull Request" button if repo allows pulls (#7426) (#7432)
* Fix vendor references (#7394) (#7396)
* Only return head: null if source branch was deleted (#6705) (#7376)
* Add missing template variable on organisation settings (#7386) (#7385)
* Fix post parameter on issue list which had unset assignee (#7380) (#7383)
* Fix migration tests due to issue 7 being resolved (#7375) (#7381)
* Correctly adjust mirror url (#6593)
* Handle early git version's lack of get-url (#7065)
* Fix icon position in issue view (#7354)
Expand Down Expand Up @@ -166,6 +205,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* Disable benchmarking during tag events on DroneIO (#6365)
* Comments list performance optimization (#5305)
* ENHANCEMENT
* Update Drone docker generation to standard format (#7480) (#7496) (#7504)
* Add API Endpoint for Repo Edit (#7006)
* Add state param to milestone listing API (#7131)
* Make captcha and password optional for external accounts (#6606)
Expand Down Expand Up @@ -285,8 +325,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
* Refactor: append, build variable and type switch (#4940)
* Git statistics in Activity tab (#4724)
* Drop the bits argument when generating an ed25519 key (#6504)
* SECURITY
* Shadow the password on cache and session config on admin panel (#7300)
* TESTING
* Exclude pull_request from fetch-tags step, fixes #7108 (#7120)
* Refactor and improve git test (#7086)
Expand Down
1 change: 0 additions & 1 deletion cmd/serv.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func fail(userMessage, logMessage string, args ...interface{}) {
if !setting.ProdMode {
fmt.Fprintf(os.Stderr, logMessage+"\n", args...)
}
return
}

os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e // indirect
github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443
github.com/go-macaron/cache v0.0.0-20151013081102-561735312776
github.com/go-macaron/captcha v0.0.0-20151123225153-8aa5919789ab
github.com/go-macaron/captcha v0.0.0-20190710000913-8dc5911259df
github.com/go-macaron/cors v0.0.0-20190309005821-6fd6a9bfe14e9
github.com/go-macaron/csrf v0.0.0-20180426211211-503617c6b372
github.com/go-macaron/i18n v0.0.0-20160612092837-ef57533c3b0f
Expand Down Expand Up @@ -135,4 +135,4 @@ require (
xorm.io/core v0.6.3
)

replace github.com/denisenkom/go-mssqldb => github.com/denisenkom/go-mssqldb v0.0.0-20180314172330-6a30f4e59a44
replace github.com/denisenkom/go-mssqldb => github.com/denisenkom/go-mssqldb v0.0.0-20180315180555-6a30f4e59a44
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ github.com/cznic/strutil v0.0.0-20181122101858-275e90344537/go.mod h1:AHHPPPXTw0
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisenkom/go-mssqldb v0.0.0-20180314172330-6a30f4e59a44 h1:x0uHqLQTSEL9LKic8sWDt3ASkq07ve5ojIIUl5uF64M=
github.com/denisenkom/go-mssqldb v0.0.0-20180314172330-6a30f4e59a44/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc=
github.com/denisenkom/go-mssqldb v0.0.0-20180315180555-6a30f4e59a44 h1:DWxZh2sImfCFn/79OUBhzFkPTKnsdDzXH/JTxpw5n6w=
github.com/denisenkom/go-mssqldb v0.0.0-20180315180555-6a30f4e59a44/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
Expand Down Expand Up @@ -113,8 +113,8 @@ github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443 h1:i801KPR7j76u
github.com/go-macaron/binding v0.0.0-20160711225916-9440f336b443/go.mod h1:u+H6rwW+HQwUL+w5uaEJSpIlVZDye1o9MB4Su0JfRfM=
github.com/go-macaron/cache v0.0.0-20151013081102-561735312776 h1:UYIHS1r0WotqB5cIa0PAiV0m6GzD9rDBcn4alp5JgCw=
github.com/go-macaron/cache v0.0.0-20151013081102-561735312776/go.mod h1:hHAsZm/oBZVcY+S7qdQL6Vbg5VrXF6RuKGuqsszt3Ok=
github.com/go-macaron/captcha v0.0.0-20151123225153-8aa5919789ab h1:4VFhsA3GE5Wwq1Ymr8KWCmrOWi1wRLEgdj48LPfQjxI=
github.com/go-macaron/captcha v0.0.0-20151123225153-8aa5919789ab/go.mod h1:j9TJ+0nwUOWBvNnm0bheHIPFf3cC62EQo7n7O6PbjZA=
github.com/go-macaron/captcha v0.0.0-20190710000913-8dc5911259df h1:MdgvtI3Y1u/DHNj7xUGOqAv+KGoTikjy8xQtCm12L78=
github.com/go-macaron/captcha v0.0.0-20190710000913-8dc5911259df/go.mod h1:j9TJ+0nwUOWBvNnm0bheHIPFf3cC62EQo7n7O6PbjZA=
github.com/go-macaron/cors v0.0.0-20190309005821-6fd6a9bfe14e9 h1:A0QGzY6UHHEil0I2e7C21JenNNG0mmrj5d9SFWTlgr8=
github.com/go-macaron/cors v0.0.0-20190309005821-6fd6a9bfe14e9/go.mod h1:utmMRnVIrXPSfA9MFcpIYKEpKawjKxf62vv62k4707E=
github.com/go-macaron/csrf v0.0.0-20180426211211-503617c6b372 h1:acrx8CnDmlKl+BPoOOLEK9Ko+SrWFB5pxRuGkKj4iqo=
Expand Down
3 changes: 2 additions & 1 deletion models/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ var (
)

const issueRefRegexpStr = `(?:([0-9a-zA-Z-_\.]+)/([0-9a-zA-Z-_\.]+))?(#[0-9]+)+`
const issueRefRegexpStrNoKeyword = `(?:\s|^|\(|\[)(?:([0-9a-zA-Z-_\.]+)/([0-9a-zA-Z-_\.]+))?(#[0-9]+)(?:\s|$|\)|\]|\.(\s|$))`

func assembleKeywordsPattern(words []string) string {
return fmt.Sprintf(`(?i)(?:%s)(?::?) %s`, strings.Join(words, "|"), issueRefRegexpStr)
Expand All @@ -73,7 +74,7 @@ func assembleKeywordsPattern(words []string) string {
func init() {
issueCloseKeywordsPat = regexp.MustCompile(assembleKeywordsPattern(issueCloseKeywords))
issueReopenKeywordsPat = regexp.MustCompile(assembleKeywordsPattern(issueReopenKeywords))
issueReferenceKeywordsPat = regexp.MustCompile(issueRefRegexpStr)
issueReferenceKeywordsPat = regexp.MustCompile(issueRefRegexpStrNoKeyword)
}

// Action represents user operation type and other information to
Expand Down
19 changes: 19 additions & 0 deletions models/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ func TestPushCommits_AvatarLink(t *testing.T) {
pushCommits.AvatarLink("[email protected]"))
}

func TestRegExp_issueReferenceKeywordsPat(t *testing.T) {
trueTestCases := []string{
"#2",
"[#2]",
"please see go-gitea/gitea#5",
}
falseTestCases := []string{
"kb#2",
"#2xy",
}

for _, testCase := range trueTestCases {
assert.True(t, issueReferenceKeywordsPat.MatchString(testCase))
}
for _, testCase := range falseTestCases {
assert.False(t, issueReferenceKeywordsPat.MatchString(testCase))
}
}

func Test_getIssueFromRef(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)
Expand Down
2 changes: 1 addition & 1 deletion models/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (protectBranch *ProtectedBranch) HasEnoughApprovals(pr *PullRequest) bool {

// GetGrantedApprovalsCount returns the number of granted approvals for pr. A granted approval must be authored by a user in an approval whitelist.
func (protectBranch *ProtectedBranch) GetGrantedApprovalsCount(pr *PullRequest) int64 {
reviews, err := GetReviewersByPullID(pr.Issue.ID)
reviews, err := GetReviewersByPullID(pr.IssueID)
if err != nil {
log.Error("GetReviewersByPullID: %v", err)
return 0
Expand Down
8 changes: 4 additions & 4 deletions models/helper_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (

// PushingEnvironment returns an os environment to allow hooks to work on push
func PushingEnvironment(doer *User, repo *Repository) []string {
return FullPushingEnvironment(doer, doer, repo, 0)
return FullPushingEnvironment(doer, doer, repo, repo.Name, 0)
}

// FullPushingEnvironment returns an os environment to allow hooks to work on push
func FullPushingEnvironment(author, committer *User, repo *Repository, prID int64) []string {
func FullPushingEnvironment(author, committer *User, repo *Repository, repoName string, prID int64) []string {
isWiki := "false"
if strings.HasSuffix(repo.Name, ".wiki") {
if strings.HasSuffix(repoName, ".wiki") {
isWiki = "true"
}

Expand All @@ -32,7 +32,7 @@ func FullPushingEnvironment(author, committer *User, repo *Repository, prID int6
"GIT_AUTHOR_EMAIL="+authorSig.Email,
"GIT_COMMITTER_NAME="+committerSig.Name,
"GIT_COMMITTER_EMAIL="+committerSig.Email,
EnvRepoName+"="+repo.Name,
EnvRepoName+"="+repoName,
EnvRepoUsername+"="+repo.MustOwnerName(),
EnvRepoIsWiki+"="+isWiki,
EnvPusherName+"="+committer.Name,
Expand Down
19 changes: 19 additions & 0 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
9 changes: 6 additions & 3 deletions models/issue_assignees.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
return err
}

return sess.Commit()
if err := sess.Commit(); err != nil {
return err
}

go HookQueue.Add(issue.RepoID)
return nil
}

func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID int64, isCreate bool) (err error) {

// Update the assignee
removed, err := updateIssueAssignee(sess, issue, assigneeID)
if err != nil {
Expand Down Expand Up @@ -209,7 +213,6 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
return nil
}
}
go HookQueue.Add(issue.RepoID)
return nil
}

Expand Down
14 changes: 2 additions & 12 deletions models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,7 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen
act.OpType = ActionReopenPullRequest
}

if opts.Issue.IsPull {
_, err = e.Exec("UPDATE `repository` SET num_closed_pulls=num_closed_pulls-1 WHERE id=?", opts.Repo.ID)
} else {
_, err = e.Exec("UPDATE `repository` SET num_closed_issues=num_closed_issues-1 WHERE id=?", opts.Repo.ID)
}
if err != nil {
if err = opts.Issue.updateClosedNum(e); err != nil {
return err
}

Expand All @@ -647,12 +642,7 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen
act.OpType = ActionClosePullRequest
}

if opts.Issue.IsPull {
_, err = e.Exec("UPDATE `repository` SET num_closed_pulls=num_closed_pulls+1 WHERE id=?", opts.Repo.ID)
} else {
_, err = e.Exec("UPDATE `repository` SET num_closed_issues=num_closed_issues+1 WHERE id=?", opts.Repo.ID)
}
if err != nil {
if err = opts.Issue.updateClosedNum(e); err != nil {
return err
}
}
Expand Down
Loading