X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FModel%2FCollectionOfRepos.pm;h=090cb8cdc4265ce6059acd58ec5dade06c32d527;hb=13c42902c178ccbb5d2e9fd174e06e8995490ff3;hp=6fdcf2ce9e0c856003edcf8aff7891bbaba165fd;hpb=31d3c3687105047265bd28672c6c76e3114c1466;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Model/CollectionOfRepos.pm b/lib/Gitalist/Model/CollectionOfRepos.pm index 6fdcf2c..090cb8c 100644 --- a/lib/Gitalist/Model/CollectionOfRepos.pm +++ b/lib/Gitalist/Model/CollectionOfRepos.pm @@ -97,15 +97,13 @@ sub _build_repos_dir { || $opts->{repos_dir} || $ENV{GITALIST_REPO_DIR} || undef; } -sub BUILD { - my $self = shift; - $self->class(); - if ($self->repos_dir) { $self->repos_dir->resolve } -} - sub build_per_context_instance { my ($self, $ctx) = @_; + $self->class(); + + if ($self->repos_dir) { $self->repos_dir->resolve } + my %args = ( export_ok => $self->export_ok || '', $self->_has_whitelist ? (whitelist => $self->whitelist) : (), @@ -117,9 +115,11 @@ sub build_per_context_instance { my $class = $self->class; - $ctx->log->debug("Using class '$class'") if $ctx->debug; + my $model = $class->new(%args); + + $ctx->log->debug("Using class '$class' " . $model->debug_string) if $ctx->debug; - return $class->new(%args); + return $model; } __PACKAGE__->meta->make_immutable;