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:
authorDouwe Maan <douwe@gitlab.com>2017-04-20 03:37:44 +0300
committerRobert Speicher <robert@gitlab.com>2017-04-20 03:37:44 +0300
commitd170133bded904603833f1b9e2727def3805962d (patch)
treea1c1e1f9973b43a5ff2482d4e1b91b219c5ac3af /app/services/validate_new_branch_service.rb
parentbfb635a4afea60751a44e6454f9c36850b5342c9 (diff)
Refactor changing files in web UI
Diffstat (limited to 'app/services/validate_new_branch_service.rb')
-rw-r--r--app/services/validate_new_branch_service.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/services/validate_new_branch_service.rb b/app/services/validate_new_branch_service.rb
index 2f61be184ce..d232e85cd33 100644
--- a/app/services/validate_new_branch_service.rb
+++ b/app/services/validate_new_branch_service.rb
@@ -8,10 +8,7 @@ class ValidateNewBranchService < BaseService
return error('Branch name is invalid')
end
- repository = project.repository
- existing_branch = repository.find_branch(branch_name)
-
- if existing_branch
+ if project.repository.branch_exists?(branch_name)
return error('Branch already exists')
end