From 52ae054447980f2efb775e43adbe5ad4bcf575e6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 30 Mar 2013 16:46:56 +0200 Subject: [PATCH] prevent exception when trying to edit empty project --- app/views/projects/_form.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 01fb6a67..2bc86d0b 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -36,10 +36,10 @@ .input = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 - - unless @repository.heads.empty? + - unless @project.empty_repo? .clearfix = f.label :default_branch, "Default Branch" - .input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;") + .input= f.select(:default_branch, @repository.branch_names, {}) - if can?(current_user, :change_public_mode, @project)