summaryrefslogtreecommitdiff
path: root/app/controllers/projects/branches_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r--app/controllers/projects/branches_controller.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index 117ae3aaa3d..3ac0a75fa70 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -17,7 +17,9 @@ class Projects::BranchesController < Projects::ApplicationController
def create
branch_name = sanitize(strip_tags(params[:branch_name]))
+ branch_name = Addressable::URI.unescape(branch_name)
ref = sanitize(strip_tags(params[:ref]))
+ ref = Addressable::URI.unescape(ref)
result = CreateBranchService.new(project, current_user).
execute(branch_name, ref)
@@ -32,9 +34,8 @@ class Projects::BranchesController < Projects::ApplicationController
end
def destroy
- status = DeleteBranchService.new(project, current_user).execute(params[:id])
- @branch_name = params[:id]
-
+ @branch_name = Addressable::URI.unescape(params[:id])
+ status = DeleteBranchService.new(project, current_user).execute(@branch_name)
respond_to do |format|
format.html do
redirect_to namespace_project_branches_path(@project.namespace,