This allows us to check inclusion for the *_exists? methods without
downloading the full list of branch names, which is over 100KiB in size
for gitlab-ce at the moment.
I attempted to refactor so that the caller of `wrap_method` passes in a
block, rather than a method name, but I was unsuccessful.
I kept getting the following error:
NoMethodError:
undefined method `cache_method_output' for Repository:Class
If you can figure this out, then feel free to dry up these class methods
again without doing a send-within-a-send.
And reuse `Gitlab::Utils::StrongMemoize`.
There is a subtle behavior change required to reuse StrongMemoize in
this case. The early fallback check now occurs *before* reading the
memoized value instead of after.
I think this is fine since a memoized value should only exist if
`exists?` is also already memoized as `true`.