From 00dd44455a499050cd225990ed3fb9954f333b4d Mon Sep 17 00:00:00 2001 From: Dan Tudor Date: Wed, 25 Mar 2015 15:15:26 +0000 Subject: Allow ability to delete branches with '/` in name --- lib/api/branches.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/api') diff --git a/lib/api/branches.rb b/lib/api/branches.rb index edfdf842f85..431d52a98ea 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -1,5 +1,4 @@ require 'mime/types' -require 'uri' module API # Projects API @@ -101,10 +100,11 @@ module API # branch (required) - The name of the branch # Example Request: # DELETE /projects/:id/repository/branches/:branch - delete ":id/repository/branches/:branch" do + delete ":id/repository/branches/:branch" + requirements: { branch: /.*/ } do authorize_push_project result = DeleteBranchService.new(user_project, current_user). - execute(URI.unescape(params[:branch])) + execute(params[:branch]) if result[:status] == :success { -- cgit v1.2.1 From a6c633567173e4675f37ec19d31094bf6c50ed3c Mon Sep 17 00:00:00 2001 From: Dan Tudor Date: Tue, 31 Mar 2015 17:08:33 +0100 Subject: Added the missing comma --- lib/api/branches.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api') diff --git a/lib/api/branches.rb b/lib/api/branches.rb index 431d52a98ea..592100a7045 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -100,7 +100,7 @@ module API # branch (required) - The name of the branch # Example Request: # DELETE /projects/:id/repository/branches/:branch - delete ":id/repository/branches/:branch" + delete ":id/repository/branches/:branch", requirements: { branch: /.*/ } do authorize_push_project result = DeleteBranchService.new(user_project, current_user). -- cgit v1.2.1