Preload all protected branches for branches endpoint
What does this MR do and why?
Preload all protected branches for branches endpoint
The protected_branches association was being preloaded, but the all_protected_branches method is being used in some cases leading to N+1 queries for unloaded access level associations.
Change all_protected_branches into an association so that it can be preloaded and used consistently.
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.
Related to #387194 (closed)
Edited by Jerry Seto