Commit 52ae054447980f2efb775e43adbe5ad4bcf575e6

Authored by Dmitriy Zaporozhets
1 parent 11b89eb3

prevent exception when trying to edit empty project

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/views/projects/_form.html.haml
@@ -36,10 +36,10 @@ @@ -36,10 +36,10 @@
36 .input 36 .input
37 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 37 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250
38 38
39 - - unless @repository.heads.empty? 39 + - unless @project.empty_repo?
40 .clearfix 40 .clearfix
41 = f.label :default_branch, "Default Branch" 41 = f.label :default_branch, "Default Branch"
42 - .input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;") 42 + .input= f.select(:default_branch, @repository.branch_names, {})
43 43
44 44
45 - if can?(current_user, :change_public_mode, @project) 45 - if can?(current_user, :change_public_mode, @project)