X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FModel%2FCollectionOfRepos.pm;h=4cc901ee6baeb74b26601ce19253e23b38523b93;hb=5e26dc93f7d8f6b3a9df80f69b3cc5f3f477f8be;hp=1e709c4f9f4bf28510f78afee9e05622ba08eb02;hpb=e33993c9be8b249ecb9f1570bb9057d4c28b3db8;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Model/CollectionOfRepos.pm b/lib/Gitalist/Model/CollectionOfRepos.pm index 1e709c4..4cc901e 100644 --- a/lib/Gitalist/Model/CollectionOfRepos.pm +++ b/lib/Gitalist/Model/CollectionOfRepos.pm @@ -12,6 +12,7 @@ use namespace::autoclean; extends 'Catalyst::Model'; +with 'Catalyst::Component::ApplicationAttribute'; with 'Catalyst::Component::InstancePerContext'; my $repo_dir_t = subtype NonEmptySimpleStr, @@ -79,8 +80,10 @@ has whitelist => ( sub _build_repo_dir { my $self = shift; - $ENV{GITALIST_REPO_DIR} ? - $ENV{GITALIST_REPO_DIR} + my $repo_dir = $self->_application->run_options->{repo_dir}; + + $repo_dir ? + $repo_dir : $self->has_config_repo_dir ? $self->config_repo_dir : '';