diff options
author | James Lopez <james@jameslopez.es> | 2016-07-11 18:00:19 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-07-11 18:00:19 +0200 |
commit | feecb4afde4cde116bcdca9c9c5059cf201720f8 (patch) | |
tree | a71159a68d6a98731e21307849e82acbfb089f97 /lib/api/branches.rb | |
parent | 0e5f0276eae25c975078f825ea10ff2c8d05563c (diff) | |
parent | 36c60b4c269a3d60f6b3e0df3bf1bfc7d44a6b54 (diff) | |
download | gitlab-ce-feecb4afde4cde116bcdca9c9c5059cf201720f8.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/import-event-error
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r-- | lib/api/branches.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb index 231840148d9..d467eb9d474 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,8 +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 @branch = user_project.repository.find_branch(params[:branch]) @@ -59,8 +58,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 @branch = user_project.repository.find_branch(params[:branch]) @@ -101,7 +99,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]) |