1
1
mirror of https://github.com/go-gitea/gitea synced 2025-11-14 02:08:12 +00:00
This commit is contained in:
Lunny Xiao
2024-12-05 21:23:51 -08:00
parent 2f7484487a
commit 2dbf22255d
2 changed files with 8 additions and 4 deletions

View File

@@ -1084,9 +1084,13 @@ func MergePullRequest(ctx *context.APIContext) {
}
defer headRepo.Close()
}
if err := pull_service.RetargetChildrenOnMerge(ctx, ctx.Doer, pr); err != nil {
ctx.Error(http.StatusInternalServerError, "RetargetChildrenOnMerge", err)
return
// TODO: why only retarget same repository pull requests?
if setting.Repository.PullRequest.RetargetChildrenOnMerge && pr.BaseRepoID == pr.HeadRepoID {
if err := pull_service.RetargetBranchPulls(ctx, ctx.Doer, pr.HeadRepoID, pr.HeadBranch, pr.BaseBranch); err != nil {
ctx.Error(http.StatusInternalServerError, "RetargetBranchPulls", err)
return
}
}
if err := repo_service.DeleteBranch(ctx, ctx.Doer, pr.HeadRepo, headRepo, pr.HeadBranch, pr); err != nil {
switch {