BlobController: missing redirect when path+reference is correct, but ref_type is not
Problem
When reference is not ambiguous, a link like returns a successful response:
https://gitlab.com/gitlab-org/gitlab/-/blob/master/.tool-versions
It also works when ref_type is correctly set (ref_type=heads loads a branch ref)
https://gitlab.com/gitlab-org/gitlab/-/blob/master/.tool-versions?ref_type=heads
However, if the ref_type points to non-existing ref, then the page load fails (because a tag with the name master is missing)
https://gitlab.com/gitlab-org/gitlab/-/blob/master/.tool-versions?ref_type=tags
Proposal
For cases when the path is not found in the provided ref, we redirect to the repository page and display a message to the user.
https://gitlab.com/gitlab-org/gitlab/-/blob/master/.tool-versions-does-not-exist
I think the case with https://gitlab.com/gitlab-org/gitlab/-/blob/master/.tool-versions?ref_type=tags should be similar to that. We can redirect the user back to the repository page as well.