Only load branch names for protected branch checks

Yorick Peterse requested to merge protected-branches-names into master

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?

What are the relevant issue numbers?

Merge request reports