Skip to content

Return an error for an invalid ref_name

Vasilii Iakliushin requested to merge verify_ref_name_in_commits_api into master

What does this MR do and why?

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

Screenshot_2022-01-31_at_16.30.09

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.

Merge request reports

Loading