Browse Source

Don't attempt to close issue if already closed (#9696)

Co-authored-by: Lauris BH <lauris@nix.lv>
for-closed-social
guillep2k 4 years ago
committed by Lunny Xiao
parent
commit
705b1e49a8
2 changed files with 9 additions and 5 deletions
  1. +5
    -3
      modules/repofiles/action.go
  2. +4
    -2
      services/pull/merge.go

+ 5
- 3
modules/repofiles/action.go View File

@ -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
}
}
}
}

+ 4
- 2
services/pull/merge.go View File

@ -374,8 +374,10 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
return err
}
close := (ref.RefAction == references.XRefActionCloses)
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
return err
if close != ref.Issue.IsClosed {
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
return err
}
}
}

Loading…
Cancel
Save