Fix the `/projects/:id/repository/branches endpoint` to handle dots in the branch name when the project full patch contains a `/`
What does this MR do?
Part 1 of #15651 (closed). This allows to make API requests for branches that contains a .
when the project full patch contains a /
.
Are there points in the code the reviewer needs to double check?
This includes a potential breaking change, that I consider being a bugfix:
- currently
GET /api/v4/projects/gitlab-org%2Fgitlab-ce/repository/branches/rc/sidekiq-test-mode
returns the branch information -
POST /api/v4/projects/gitlab-org%2Fgitlab-ce/repository/branches/rc/sidekiq-test-mode/protect
works as well because there are not conflicting routes - For instance, this breaks for
GET /api/v4/projects/13083/repository/branches/rc/sidekiq-test-mode/commits
- I believe this is a bug and branch names should be always be escaped, i.e.
rc%2Fsidekiq-test-mode
I will follow this MR with an MR for the tags and the commits endpoints.
Why was this MR needed?
Because branches that contain a .
couldn't be dealt with when the project full patch contains a /
.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
Edited by username-removed-128633