Commit 4ac56fa1db2286848b1bed9df3aeec8685c4cbd3

Authored by Jeroen van Baarsen
1 parent d0e794cc

Changed some stuff around after rebase

app/controllers/projects/branches_controller.rb
... ... @@ -23,8 +23,8 @@ class Projects::BranchesController < Projects::ApplicationController
23 23 end
24 24  
25 25 def destroy
26   - @branch = @repository.find_branch(params[:id])
27 26 DeleteBranchService.new.execute(project, params[:id], current_user)
  27 + @branch_name = params[:id]
28 28  
29 29 respond_to do |format|
30 30 format.html { redirect_to project_branches_path(@project) }
... ...
app/views/projects/branches/destroy.js.haml
1 1 :plain
2   - $(".js-branch-#{@branch.name}").remove();
3   - $('.js-recentbranch-count').html("#{@repository.recent_branches.count}")
4   - $('.js-protectedbranch-count').html("#{@project.protected_branches.count}")
5   - $('.js-totalbranch-count').html("#{@repository.branch_names.count}")
  2 + $(".js-branch-#{@branch_name}").remove();
  3 + $('.js-totalbranch-count').html("#{@repository.branches.size}")
... ...