fix(pulls): hide branch deletion when an open PR uses the branch (#39193) (#39218)

Co-authored-by: 开心 <happys2333@outlook.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
Giteabot
2026-09-04 02:56:58 +02:00
committed by GitHub
co-authored by 开心 wxiaoguang silverwind
parent e3d9b03f84
commit c51da382d1
2 changed files with 47 additions and 40 deletions
+1 -1
View File
@@ -594,7 +594,7 @@ func (prInfo *pullRequestViewInfo) prepareMergeBoxDeleteBranch(ctx *context.Cont
isPullBranchDeletable, _ = git_model.IsBranchExist(ctx, pull.HeadRepo.ID, pull.HeadBranch)
}
if isPullBranchDeletable && pull.HasMerged {
if isPullBranchDeletable && prInfo.issue.IsClosed {
exist, err := issues_model.HasUnmergedPullRequestsByHeadInfo(ctx, pull.HeadRepoID, pull.HeadBranch)
if err != nil {
ctx.ServerError("HasUnmergedPullRequestsByHeadInfo", err)