Commit e569cf36 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #6991 from jvanbaarsen/branch-counter-after-delete

Make sure the branch counter gets updated
parents 6fdd9008 4ac56fa1
...@@ -24,10 +24,11 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -24,10 +24,11 @@ class Projects::BranchesController < Projects::ApplicationController
def destroy def destroy
DeleteBranchService.new.execute(project, params[:id], current_user) DeleteBranchService.new.execute(project, params[:id], current_user)
@branch_name = params[:id]
respond_to do |format| respond_to do |format|
format.html { redirect_to project_branches_path(@project) } format.html { redirect_to project_branches_path(@project) }
format.js { render nothing: true } format.js
end end
end end
end end
- commit = @repository.commit(branch.target) - commit = @repository.commit(branch.target)
%li %li(class="js-branch-#{branch.name}")
%h4 %h4
= link_to project_tree_path(@project, branch.name) do = link_to project_tree_path(@project, branch.name) do
%strong= truncate(branch.name, length: 60) %strong= truncate(branch.name, length: 60)
......
:plain
$(".js-branch-#{@branch_name}").remove();
$('.js-totalbranch-count').html("#{@repository.branches.size}")
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= nav_link(html_options: {class: branches_tab_class}) do = nav_link(html_options: {class: branches_tab_class}) do
= link_to project_branches_path(@project) do = link_to project_branches_path(@project) do
Branches Branches
%span.badge= @repository.branches.size %span.badge.js-totalbranch-count= @repository.branches.size
= nav_link(controller: :tags) do = nav_link(controller: :tags) do
= link_to project_tags_path(@project) do = link_to project_tags_path(@project) do
......
Markdown is supported
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