summaryrefslogtreecommitdiff
path: root/app/helpers/compare_helper.rb
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2017-10-10 14:56:04 +0000
committerRémy Coutable <remy@rymai.me>2017-10-10 14:56:04 +0000
commit47d19c2de1df14bb3ab00d051be8e4f19f4ed7c4 (patch)
treea937896d47c846185e397528bdd6fa3e64ae78b9 /app/helpers/compare_helper.rb
parent900dd7fa93ee9de3de767aa4bf5baca7e9f83348 (diff)
downloadgitlab-ce-47d19c2de1df14bb3ab00d051be8e4f19f4ed7c4.tar.gz
Stop using `branch_names.include?` and use `branch_exists?`
Diffstat (limited to 'app/helpers/compare_helper.rb')
-rw-r--r--app/helpers/compare_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/compare_helper.rb b/app/helpers/compare_helper.rb
index 2c28dd81c87..8bf96c0905f 100644
--- a/app/helpers/compare_helper.rb
+++ b/app/helpers/compare_helper.rb
@@ -4,8 +4,8 @@ module CompareHelper
to.present? &&
from != to &&
can?(current_user, :create_merge_request, project) &&
- project.repository.branch_names.include?(from) &&
- project.repository.branch_names.include?(to)
+ project.repository.branch_exists?(from) &&
+ project.repository.branch_exists?(to)
end
def create_mr_path(from = params[:from], to = params[:to], project = @project)