Copy Gitlab::Git::Repsitory#exists implementation
Copying the implementation allows the code to continue working after the call is made to Gitaly only and moved out of the OPT_OUT feature flag state.
CE MR: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18567