From: Dan Brook Date: Sun, 13 Nov 2011 22:40:53 +0000 (+0000) Subject: Ressurect repo_dir as it is still in use. X-Git-Tag: 0.003007~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=91b8538e121dcb3f9326cc8c59f9b178f640bc48;p=catagits%2FGitalist.git Ressurect repo_dir as it is still in use. May be worth deprecating or at least documenting clearly. It's usually not healthy to have singular & plural options do slightly different things. --- diff --git a/lib/Gitalist/Model/CollectionOfRepos.pm b/lib/Gitalist/Model/CollectionOfRepos.pm index 5dead00..9ac5f78 100644 --- a/lib/Gitalist/Model/CollectionOfRepos.pm +++ b/lib/Gitalist/Model/CollectionOfRepos.pm @@ -67,6 +67,13 @@ has whitelist => ( predicate => '_has_whitelist', ); +has repo_dir => ( + is => 'ro', + isa => DirOrUndef, + coerce => 1, + predicate => '_has_repo_dir', +); + # Simple directory of repositories (for list) has repos_dir => ( is => 'ro', @@ -85,7 +92,9 @@ has repos => ( sub _build_repos_dir { my $self = shift; - my $dir = $self->_application->run_options->{repo_dir} || $ENV{GITALIST_REPO_DIR } || undef; + my $opts = $self->_application->run_options || {}; + return $self->_has_repo_dir && $self->repo_dir + || $opts->{repos_dir} || $ENV{GITALIST_REPO_DIR} || undef; } sub BUILD {