Commit ee993dfc645bbe98431d3181e0d544d50b13c4de

Authored by Timm Drevensek
1 parent 5cf5c177

Fix branches/compare butten to directly diff to default branch

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
app/views/projects/branches/_branch.html.haml
... ... @@ -11,9 +11,10 @@
11 11 .pull-right
12 12 - if can?(current_user, :download_code, @project)
13 13 = render 'projects/repositories/download_archive', ref: branch.name, btn_class: 'grouped btn-group-small'
14   - = link_to project_compare_index_path(@project, from: branch.name, to: branch.name), class: 'btn grouped btn-small', title: "Compare" do
15   - %i.icon-copy
16   - Compare
  14 + - if branch.name != @repository.root_ref
  15 + = link_to project_compare_index_path(@project, from: @repository.root_ref, to: branch.name), class: 'btn grouped btn-small', method: :post, title: "Compare" do
  16 + %i.icon-copy
  17 + Compare
17 18  
18 19 - if can?(current_user, :admin_project, @project) && branch.name != @repository.root_ref
19 20 = link_to project_branch_path(@project, branch.name), class: 'btn grouped btn-small remove-row', method: :delete, data: { confirm: 'Removed branch cannot be restored. Are you sure?'}, remote: true do
... ...