Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-06-30 14:46:35 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2016-06-30 14:46:35 +0300
commitcc324eb4ab6f10386dccd891f6b3fdd14b91d2e6 (patch)
tree7d602ba23c15f99a7c4b8b5cea7f35befe7ff6b5 /lib/api/branches.rb
parentb32a6add8fa602eb35648f3f4661df8b98d909cb (diff)
Ensure that branch and tag names are given in API
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r--lib/api/branches.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index 231840148d9..9f9ae75ff65 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -25,7 +25,7 @@ module API
# branch (required) - The name of the branch
# Example Request:
# GET /projects/:id/repository/branches/:branch
- get ':id/repository/branches/:branch', requirements: { branch: /.*/ } do
+ get ':id/repository/branches/:branch', requirements: { branch: /.+/ } do
@branch = user_project.repository.branches.find { |item| item.name == params[:branch] }
not_found!("Branch") unless @branch
present @branch, with: Entities::RepoObject, project: user_project
@@ -39,7 +39,7 @@ module API
# Example Request:
# PUT /projects/:id/repository/branches/:branch/protect
put ':id/repository/branches/:branch/protect',
- requirements: { branch: /.*/ } do
+ requirements: { branch: /.+/ } do
authorize_admin_project
@@ -59,7 +59,7 @@ module API
# Example Request:
# PUT /projects/:id/repository/branches/:branch/unprotect
put ':id/repository/branches/:branch/unprotect',
- requirements: { branch: /.*/ } do
+ requirements: { branch: /.+/ } do
authorize_admin_project
@@ -101,7 +101,7 @@ module API
# Example Request:
# DELETE /projects/:id/repository/branches/:branch
delete ":id/repository/branches/:branch",
- requirements: { branch: /.*/ } do
+ requirements: { branch: /.+/ } do
authorize_push_project
result = DeleteBranchService.new(user_project, current_user).
execute(params[:branch])