This function was added in 02719bdbb5, and
used newDefaultRepositoryEndpoint to get repository info for the given
image-reference.
newDefaultRepositoryEndpoint uses registry.ParseRepositoryInfo under the
hood, but the only information used from the result was the Name field,
which is set using `reference.TrimNamed(name)`. The possible error returned
was based on the domain-name of the image, and only checked for the domain
to not start, or end with a hyphen ("-").
This patch removes the use of RepoNameForReference, deprecates it, and
inlines the code used by it.
There are no known consumers of this function, so we can consider removing
it in the first possible release after this (which can be a minor release).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>