Commit e569cf369ab9457d078c0f40dbbb7a67db4c6221
Exists in
spb-stable
and in
2 other branches
Merge pull request #6991 from jvanbaarsen/branch-counter-after-delete
Make sure the branch counter gets updated
Showing
4 changed files
with
7 additions
and
3 deletions
Show diff stats
app/controllers/projects/branches_controller.rb
... | ... | @@ -24,10 +24,11 @@ class Projects::BranchesController < Projects::ApplicationController |
24 | 24 | |
25 | 25 | def destroy |
26 | 26 | DeleteBranchService.new.execute(project, params[:id], current_user) |
27 | + @branch_name = params[:id] | |
27 | 28 | |
28 | 29 | respond_to do |format| |
29 | 30 | format.html { redirect_to project_branches_path(@project) } |
30 | - format.js { render nothing: true } | |
31 | + format.js | |
31 | 32 | end |
32 | 33 | end |
33 | 34 | end | ... | ... |
app/views/projects/branches/_branch.html.haml
app/views/projects/commits/_head.html.haml
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | = nav_link(html_options: {class: branches_tab_class}) do |
10 | 10 | = link_to project_branches_path(@project) do |
11 | 11 | Branches |
12 | - %span.badge= @repository.branches.size | |
12 | + %span.badge.js-totalbranch-count= @repository.branches.size | |
13 | 13 | |
14 | 14 | = nav_link(controller: :tags) do |
15 | 15 | = link_to project_tags_path(@project) do | ... | ... |