summaryrefslogtreecommitdiff
path: root/app/services/validate_new_branch_service.rb
diff options
context:
space:
mode:
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