New RPC to check whether remote name exists
To fix https://gitlab.com/gitlab-org/gitlab-ce/issues/50562, we would like to check if the remote name exists on a repository before adding it unless we are okay with calling RemoteService#AddRemote
and letting git
complain with fatal: remote my-remote already exists.
I notice we have RemoteService#RemoteRepositoryExists
, but this actually just checks whether the remote URL exists. I thought it would behave similarly to RemoteService#AddRemote
or RemoteService#RemoteRemote
, but it does not. I think we want to add RemoteService#RemoteExists
here.