2013-09-12 13:15:10 -04:00
|
|
|
module CompareHelper
|
|
|
|
def compare_to_mr_button?
|
2013-12-04 03:02:36 -05:00
|
|
|
@project.merge_requests_enabled &&
|
|
|
|
params[:from].present? &&
|
|
|
|
params[:to].present? &&
|
2013-09-12 13:15:10 -04:00
|
|
|
@repository.branch_names.include?(params[:from]) &&
|
|
|
|
@repository.branch_names.include?(params[:to]) &&
|
2013-09-12 14:39:27 -04:00
|
|
|
params[:from] != params[:to] &&
|
2013-09-12 13:15:10 -04:00
|
|
|
!@refs_are_same
|
|
|
|
end
|
|
|
|
|
|
|
|
def compare_mr_path
|
2013-09-12 13:23:03 -04:00
|
|
|
new_project_merge_request_path(@project, merge_request: {source_branch: params[:to], target_branch: params[:from]})
|
2013-09-12 13:15:10 -04:00
|
|
|
end
|
|
|
|
end
|