diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2015-12-16 16:29:31 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2015-12-16 16:34:03 -0200 |
commit | 9c266d49354e9f7f86c76b00fbe800912f475153 (patch) | |
tree | a7c5294321d441d7a9fb254453e74588642fee33 /app | |
parent | 76642d7a805e572ddd7608efa4f6f33de42fa1ce (diff) | |
download | gitlab-ce-9c266d49354e9f7f86c76b00fbe800912f475153.tar.gz |
Add more descriptive error message when create branch with invalid name
Diffstat (limited to 'app')
-rw-r--r-- | app/services/create_branch_service.rb | 2 | ||||
-rw-r--r-- | app/views/projects/branches/new.html.haml | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/services/create_branch_service.rb b/app/services/create_branch_service.rb index de18f3bc556..6a77f51628e 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 invalid') + return error("Branch name can't contains space, '~', '^', ':', '?', '*', '[', '\', '..', '@{', and consecutive slashes, start with '/' or '.' or end in '/' or '.' or '.lock'") end repository = project.repository diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml index 31943a2407a..4e94f2a5ea2 100644 --- a/app/views/projects/branches/new.html.haml +++ b/app/views/projects/branches/new.html.haml @@ -14,6 +14,7 @@ = label_tag :branch_name, nil, class: 'control-label' .col-sm-10 = text_field_tag :branch_name, params[:branch_name], required: true, tabindex: 1, autofocus: true, class: 'form-control' + .help-block Can't contains space, '~', '^', ':', '?', '*', '[', '\', '..', '@{', and consecutive slashes, start with '/' or '.' or end in '/' or '.' or '.lock' .form-group = label_tag :ref, 'Create from', class: 'control-label' .col-sm-10 |