Strong memoize tag_names and branch_names in repository settings
Context
From this discussion:
Protected tags and branches don't support regular expressions - they use
*as a wildcard instead.The search logic implemented here should cover this case. If that's sufficient, then we can skip any changes to Gitaly RPC and just replace cases when protected branches/tags search by a pattern to use
RefsFinderinstead ofbranches_namesandtags_namescalls.
Now that protected_tags and protected_branches use the RefsFinder class and pagination Gitaly page-token pagination to protected_tags ... (#559195 - closed), we should use strong memoization for tag_names and branch_names in projects/settings/repository_controller#show. This optimization will reduce external dependencies (Redis cache) and improve response times by keeping frequently accessed data available throughout the request lifecycle.