Project.repository should never be nil so you can call repository.exists? or repository.empty?
Also specify separate project factory for project with filled repo
This commit is contained in:
parent
49b024f5f5
commit
541d899410
13 changed files with 51 additions and 54 deletions
|
@ -96,7 +96,7 @@ module ApplicationHelper
|
|||
]
|
||||
|
||||
project_nav = []
|
||||
if @project && @project.repository && @project.repository.root_ref
|
||||
if @project && @project.repository.exists? && @project.repository.root_ref
|
||||
project_nav = [
|
||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Issues", url: project_issues_path(@project) },
|
||||
{ label: "#{simple_sanitize(@project.name_with_namespace)} - Commits", url: project_commits_path(@project, @ref || @project.repository.root_ref) },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue