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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
开心
2026-09-02 17:36:22 +00:00
committed by GitHub
co-authored by wxiaoguang
parent 8cf7330556
commit 52fcd2d2a0
2 changed files with 47 additions and 40 deletions
+1 -1
View File
@@ -591,7 +591,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)