our $SHA1RE = qr/[0-9a-fA-F]{40}/;
has name => ( isa => NonEmptySimpleStr,
- is => 'ro' );
+ is => 'ro', required => 1 );
has path => ( isa => "Path::Class::Dir",
- is => 'ro');
+ is => 'ro', required => 1);
has description => ( isa => Str,
is => 'ro',
handles => [ 'run_cmd' ],
);
+ method BUILD {
+ $self->$_() for qw/_util last_change owner description/; # Ensure to build early.
+ }
+
method _build__util {
my $util = Gitalist::Git::Util->new(
gitdir => $self->project_dir($self->path),
return @ret;
}
-
+ # FIXME - Why not just stay in Path::Class land and return a P::C::D here?
method project_dir {
my $dir = $self->path->stringify;
$dir .= '/.git'