Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/validate_new_branch_service.rb')
-rw-r--r--app/services/validate_new_branch_service.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/app/services/validate_new_branch_service.rb b/app/services/validate_new_branch_service.rb
deleted file mode 100644
index 3f4a59e5cee..00000000000
--- a/app/services/validate_new_branch_service.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'base_service'
-
-class ValidateNewBranchService < BaseService
- def execute(branch_name, force: false)
- valid_branch = Gitlab::GitRefValidator.validate(branch_name)
-
- unless valid_branch
- return error('Branch name is invalid')
- end
-
- if project.repository.branch_exists?(branch_name) && !force
- return error('Branch already exists')
- end
-
- success
- rescue Gitlab::Git::PreReceiveError => ex
- error(ex.message)
- end
-end