diff options
author | guillep2k <18600385+guillep2k@users.noreply.github.com> | 2020-01-10 22:20:11 -0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-11 09:20:11 +0800 |
commit | 705b1e49a8b2ac8df377120f70f3548df15cdf49 (patch) | |
tree | 98179854c551616dd75dab8eda26838be58ba962 /modules/repofiles/action.go | |
parent | 438e159d04dc726b7872747d1a05a8ed6b528037 (diff) | |
download | gitea-705b1e49a8b2ac8df377120f70f3548df15cdf49.tar.gz gitea-705b1e49a8b2ac8df377120f70f3548df15cdf49.zip |
Don't attempt to close issue if already closed (#9696)
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/repofiles/action.go')
-rw-r--r-- | modules/repofiles/action.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go index 07bc1b875b..3be6509bc2 100644 --- a/modules/repofiles/action.go +++ b/modules/repofiles/action.go @@ -138,9 +138,11 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*r continue } } - - if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil { - return err + close := (ref.Action == references.XRefActionCloses) + if close != refIssue.IsClosed { + if err := changeIssueStatus(refRepo, refIssue, doer, close); err != nil { + return err + } } } } |