diff options
author | yp05327 <576951401@qq.com> | 2023-07-26 02:31:09 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 12:31:09 -0500 |
commit | 53586e9d609d61204a750b11cd3990b4ba923e24 (patch) | |
tree | 04b383cb665e9d296b76ed8fca77bd022c8ed9f4 | |
parent | 81f5d5b7229847cd4f07930733a55e9d45946c7d (diff) | |
download | gitea-53586e9d609d61204a750b11cd3990b4ba923e24.tar.gz gitea-53586e9d609d61204a750b11cd3990b4ba923e24.zip |
Avoid opening/closing PRs which are already merged (#25883) (#26108)
-rw-r--r-- | routers/web/repo/issue.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 616e08e4d8..0e6c7ad2bd 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -2654,6 +2654,13 @@ func UpdateIssueStatus(ctx *context.Context) { return } for _, issue := range issues { + if err := issue.LoadPullRequest(ctx); err != nil { + ctx.ServerError("LoadPullRequests", err) + return + } + if issue.IsPull && issue.PullRequest.HasMerged { + continue + } if issue.IsClosed != isClosed { if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil { if issues_model.IsErrDependenciesLeft(err) { |