diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-04-20 03:37:44 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-04-20 03:37:44 +0300 |
commit | d170133bded904603833f1b9e2727def3805962d (patch) | |
tree | a1c1e1f9973b43a5ff2482d4e1b91b219c5ac3af /app/services/validate_new_branch_service.rb | |
parent | bfb635a4afea60751a44e6454f9c36850b5342c9 (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.rb | 5 |
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 |