mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-12 19:58:06 +00:00
74ad781db9
Backport #38319 by @bircni The `official` flag of a pull request review is computed against the target branch's protection rules at submit time and stored on the review record. `ChangeTargetBranch` updated the base branch but never re-evaluated it, so an `official` approval obtained against an unprotected branch could be retargeted onto a protected branch and satisfy its required approvals, bypassing the branch protection. This re-evaluates the `official` flag of the latest approve/reject reviews against the new base branch whenever the target branch changes. Co-authored-by: bircni <bircni@icloud.com>