From 1757e6ef65a1cedbfe5d5b5da894d6d0d3d5ef16 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Thu, 17 Dec 2015 16:59:15 -0200 Subject: Add JS validation for invalid characters in branch name More info about valid ref names: https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.ht ml --- app/services/create_branch_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services/create_branch_service.rb') diff --git a/app/services/create_branch_service.rb b/app/services/create_branch_service.rb index 6a77f51628e..a6844985c4e 100644 --- a/app/services/create_branch_service.rb +++ b/app/services/create_branch_service.rb @@ -4,7 +4,7 @@ class CreateBranchService < BaseService def execute(branch_name, ref) valid_branch = Gitlab::GitRefValidator.validate(branch_name) if valid_branch == false - return error("Branch name can't contains space, '~', '^', ':', '?', '*', '[', '\', '..', '@{', and consecutive slashes, start with '/' or '.' or end in '/' or '.' or '.lock'") + return error('Branch name is invalid') end repository = project.repository -- cgit v1.2.1