Commit 2d076394aa9e39fc1b6ec58b6cfcf21d0c0345af
1 parent
0530e5ba
Exists in
master
and in
4 other branches
Fix github issue #967
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
app/views/protected_branches/index.html.haml
@@ -39,10 +39,13 @@ | @@ -39,10 +39,13 @@ | ||
39 | - if branch.name == @project.root_ref | 39 | - if branch.name == @project.root_ref |
40 | %span.label default | 40 | %span.label default |
41 | %td | 41 | %td |
42 | - = link_to project_commit_path(@project, branch.commit.id) do | ||
43 | - = truncate branch.commit.id.to_s, length: 10 | ||
44 | - = time_ago_in_words(branch.commit.committed_date) | ||
45 | - ago | 42 | + - if branch.commit |
43 | + = link_to project_commit_path(@project, branch.commit.id) do | ||
44 | + = truncate branch.commit.id.to_s, length: 10 | ||
45 | + = time_ago_in_words(branch.commit.committed_date) | ||
46 | + ago | ||
47 | + - else | ||
48 | + (branch was removed from repository) | ||
46 | %td | 49 | %td |
47 | - if can? current_user, :admin_project, @project | 50 | - if can? current_user, :admin_project, @project |
48 | = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" | 51 | = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" |