diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-20 15:38:54 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-20 15:38:54 +0200 |
commit | 95c59b2e0871667f8ef6ae53b11228568b3d7f03 (patch) | |
tree | 1cdba1e0dee097cd51b79a9f17ada9fce866fa9c /app/helpers | |
parent | 98cede7ebeae9dac994b35b66be6aab14eb932b3 (diff) | |
download | gitlab-ce-reduce-git-calls.tar.gz |
Trying to reduce git callsreduce-git-calls
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/branches_helper.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 439b015b3b8..479b6ddebef 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -132,7 +132,7 @@ module ApplicationHelper return false if project.merge_requests.where(source_branch: event.branch_name).opened.any? # Skip if user removed branch right after that - return false unless project.repository.branch_names.include?(event.branch_name) + return false unless project.repository.branch_exists?(event.branch_name) true end diff --git a/app/helpers/branches_helper.rb b/app/helpers/branches_helper.rb index 3ee3fc74f0c..c533659b600 100644 --- a/app/helpers/branches_helper.rb +++ b/app/helpers/branches_helper.rb @@ -10,7 +10,7 @@ module BranchesHelper end def can_push_branch?(project, branch_name) - return false unless project.repository.branch_names.include?(branch_name) + return false unless project.repository.branch_exists?(branch_name) ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(branch_name) end |