Return an error for an invalid ref_name
What does this MR do and why?
- Contributes to #351520 (closed)
- Sentry error: https://sentry.gitlab.net/gitlab/gitlabcom/issues/3173142/
Problem
Git ref cannot start with -
. Currently we return an ArgumentError
from the Gitaly.
Solution
Verify the ref_name with regexp
Screenshots or screen recordings
How to set up and validate locally
http://127.0.0.1:3000/api/v4/projects/6/repository/commits?ref_name=-main
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.