Skip to content

Return allow_force_push: false always when security policy enforced

What does this MR do and why?

This MR fixes API inconsistency where allow_force_push should return false when security policy is enforced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Create a protected branch and enable allow force push
  2. Create a security policy with prevent_pushing_and_force_pushing: true for the protected branch
  3. View the protected branch in the UI
  4. View the protected branch information from the API
  5. Both should return information that force_push is not possible

Related to #436075 (closed)

Merge request reports