Fix protected branches API to accept name parameter with dot

This commit is contained in:
Mark Fletcher 2018-01-19 20:07:44 +00:00
parent ee58763158
commit 5a160b05ed
3 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
title: Fix protected branches API to accept name parameter with dot
merge_request:
author:
type: fixed

View file

@ -2,7 +2,7 @@ module API
class ProtectedBranches < Grape::API
include PaginationParams
BRANCH_ENDPOINT_REQUIREMENTS = API::PROJECT_ENDPOINT_REQUIREMENTS.merge(branch: API::NO_SLASH_URL_PART_REGEX)
BRANCH_ENDPOINT_REQUIREMENTS = API::PROJECT_ENDPOINT_REQUIREMENTS.merge(name: API::NO_SLASH_URL_PART_REGEX)
before { authorize_admin_project }

View file

@ -80,6 +80,12 @@ describe API::ProtectedBranches do
it_behaves_like 'protected branch'
end
context 'when protected branch contains a period' do
let(:protected_name) { 'my.feature' }
it_behaves_like 'protected branch'
end
end
context 'when authenticated as a guest' do