diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 616e08e4d88ac..09de32ded4502 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -2653,7 +2653,15 @@ func UpdateIssueStatus(ctx *context.Context) { ctx.ServerError("LoadRepositories", err) return } + if err := issues.LoadPullRequests(ctx); err != nil { + ctx.ServerError("LoadPullRequests", err) + return + } + for _, issue := range issues { + 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) {