Commit a3edd473 authored by Douwe Maan's avatar Douwe Maan

Improve create_mr_button? performance.

parent e80c4447
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment