summaryrefslogtreecommitdiff
path: root/app/services/create_branch_service.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-17 16:59:15 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-17 17:17:37 -0200
commit1757e6ef65a1cedbfe5d5b5da894d6d0d3d5ef16 (patch)
treeae3512b6b49c95451869d9e486d94155448bd3e3 /app/services/create_branch_service.rb
parentc91cf1f66b3ed4329b313b7b75fca816fc5c6076 (diff)
downloadgitlab-ce-1757e6ef65a1cedbfe5d5b5da894d6d0d3d5ef16.tar.gz
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
Diffstat (limited to 'app/services/create_branch_service.rb')
-rw-r--r--app/services/create_branch_service.rb2
1 files changed, 1 insertions, 1 deletions
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