Re-implement Rugged::Reference.valid_name?(ref_name)
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=430709) </details> <!--IssueSummary end--> Follow-up for https://gitlab.com/gitlab-org/gitlab/-/issues/421591+ Most of Rugged code was removed, but there is still a single instance when we rely on it. [Gitlab::GitRefValidator](https://gitlab.com/gitlab-org/gitlab/blob/b4ada6a3047c8bd4b61b3b00ad262b2d45dc689f/lib/gitlab/git_ref_validator.rb#L21) uses Rugged to validate the correctness of the git reference. That's the only blocker that stops us from the full removal of `rugged` gem. ### Proposal Re-implement Rugged reference check in Ruby. Rugged implementation: https://github.com/libgit2/rugged/blob/ae109768286079e7c8b041c5c7c81962c08d9916/ext/rugged/rugged_reference.c#L43-L59
issue