f774949d3f
* Show new merge request button from compare page * Show message if user selected same branches * Show message if compared branches are the same * Prepend inputs with from/to labels
12 lines
398 B
Ruby
12 lines
398 B
Ruby
module CompareHelper
|
|
def compare_to_mr_button?
|
|
params[:from].present? && params[:to].present? &&
|
|
@repository.branch_names.include?(params[:from]) &&
|
|
@repository.branch_names.include?(params[:to]) &&
|
|
!@refs_are_same
|
|
end
|
|
|
|
def compare_mr_path
|
|
new_project_merge_request_path(@project, merge_request: {source_branch: params[:from], target_branch: params[:to]})
|
|
end
|
|
end
|