Encode the remote root ref returned by Gitlab::Git::Repository#find_remote_root_ref.
Gitlab::Git::Repository#find_remote_root_ref
https://gitlab.com/gitlab-org/gitlab-ee/issues/7211