404 when trying to use "Raw file content" API with branch containing dots in name
Summary
If a branch name contains dots (e.g., 0.1.0
), the "raw file content" API returns a 404, even if the file exists.
Steps to reproduce
- Create a branch
0.1.0
in a repository containing a file (e.g.,README.md
) - Use the Raw file content API endpoint to try and fetch the file
- E.g., `GET https://gitlab.com/api/v3/projects/janslow%2ftest/repository/blobs/0.1.0?filepath=README.md
curl -X GET -H "PRIVATE-TOKEN: ****" -H "Cache-Control: no-cache" "https://gitlab.com/api/v3/projects/janslow%2ftest/repository/blobs/0.1.0?filepath=README.md"
Expected behavior
It should return the contents of the file/blob
Actual behavior
Returns a HTTP 404 status
{
"error": "404 Not Found"
}
Output of checks
This bug happens on GitLab.com