Commit 5157f8e2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'request/branch_compare' into 'master'

Fix for compare button within branches dialog

For the button Compare within the Branches screen ( ) beside a branch "foo"

Old behavior:
Will redirect to the compare page that is defaulted to comparison for branch "foo" <--> "foo"

New behavior:
Will redirect and trigger compare page of branch "default" <--> "foo"
Remove of button beside default branch
......@@ -11,9 +11,10 @@
- if can?(current_user, :download_code, @project)
= render 'projects/repositories/download_archive', ref:, btn_class: 'grouped btn-group-small'
= link_to project_compare_index_path(@project, from:, to:, class: 'btn grouped btn-small', title: "Compare" do
- if != @repository.root_ref
= link_to project_compare_index_path(@project, from: @repository.root_ref, to:, class: 'btn grouped btn-small', method: :post, title: "Compare" do
- if can?(current_user, :admin_project, @project) && != @repository.root_ref
= link_to project_branch_path(@project,, class: 'btn grouped btn-small remove-row', method: :delete, data: { confirm: 'Removed branch cannot be restored. Are you sure?'}, remote: true do
Supports Markdown
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