Only load branch names for protected branch checks
What does this MR do?
This changes the code used for checking for protected branches so we only load the names into memory. This won't result in a big difference (if any) in SQL queries, it just reduces the amount of data being sent over the wire / loaded into memory.
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Has been reviewed by Backend
- Has been reviewed by Database
- Conform by the merge request performance guides
- Conform by the style guides
- Squashed related commits together
- Internationalization required/considered