summaryrefslogtreecommitdiff
path: root/app/helpers/compare_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-05-09 23:51:50 +0200
committerDouwe Maan <douwe@gitlab.com>2015-05-09 23:51:50 +0200
commita3edd473b936de0be841c003506a41e0ff941b9e (patch)
treef2b986d2ef3fa05f9a50fd00b4d14ce5d0f1e713 /app/helpers/compare_helper.rb
parente80c4447a82553d74267f327060b96807c2e5c0c (diff)
downloadgitlab-ce-a3edd473b936de0be841c003506a41e0ff941b9e.tar.gz
Improve create_mr_button? performance.
Diffstat (limited to 'app/helpers/compare_helper.rb')
-rw-r--r--app/helpers/compare_helper.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/helpers/compare_helper.rb b/app/helpers/compare_helper.rb
index fe339d32155..f1dc906cab4 100644
--- a/app/helpers/compare_helper.rb
+++ b/app/helpers/compare_helper.rb
@@ -1,12 +1,11 @@
module CompareHelper
def create_mr_button?(from = params[:from], to = params[:to], project = @project)
- project.merge_requests_enabled &&
- from.present? &&
+ from.present? &&
to.present? &&
- project.repository.branch_names.include?(from) &&
- project.repository.branch_names.include?(to) &&
from != to &&
- !@refs_are_same
+ project.merge_requests_enabled &&
+ project.repository.branch_names.include?(from) &&
+ project.repository.branch_names.include?(to)
end
def create_mr_path(from = params[:from], to = params[:to], project = @project)