Optimization: don't load group if not needed
What does this MR do and why?
Contributes to #482942 (closed)
Problem
belongs_to without optional: true executes a DB query even when
namespace_id is NULL.
Solution
Use optional: true for group relation of ProtectedBranch.
Edited by Vasilii Iakliushin