1 package Gitalist::Git::Object::HasTree;
4 role Gitalist::Git::Object::HasTree {
5 has tree => ( isa => 'ArrayRef[Gitalist::Git::Object]',
13 my $output = $self->_run_cmd(qw/ls-tree -z/, $self->sha1);
14 return unless defined $output;
17 for my $line (split /\0/, $output) {
18 my ($mode, $type, $object, $file) = split /\s+/, $line, 4;
19 my $class = 'Gitalist::Git::Object::' . ucfirst($type);
20 push @ret, $class->new( mode => oct $mode,
24 repository => $self->repository,
41 Gitalist::Git::Object::HasTree
45 my $tree = Repository->get_object($tree_sha1);
49 Role for objects which have a tree - C<Commit> and C<Tree> objects.
62 See L<Gitalist> for authors.
66 See L<Gitalist> for the license.