| 1 | package Git::Gitalist::Object::HasTree; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use Method::Signatures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | has tree => ( | |||||||||
| 8 | isa => 'ArrayRef[Git::Gitalist::Object]', | ||||||||||
| 9 | required => 0, | ||||||||||
| 10 | is => 'ro', | ||||||||||
| 11 | lazy_build => 1, | ||||||||||
| 12 | ); | ||||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | method _build_tree { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
_build_tree: not called CC=5 SCAR=31.3
Branch: 1 branch
| |||||||||||
| 16 | 0 | my $output = $self->_run_cmd(qw/ls-tree -z/, $self->sha1); | |||||||||
| 17 | 0 | ▶ | return unless defined $output; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | |||||||||||
| 19 | 0 | my @ret; | |||||||||
| 20 | 0 | for my $line (split /\0/, $output) { | |||||||||
| 21 | 0 | my ($mode, $type, $object, $file) = split /\s+/, $line, 4; | |||||||||
| 22 | # Ignore commits, these represent submodules | ||||||||||
| 23 | 0 | ▶ | next if $type eq 'commit'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | my $class = 'Git::Gitalist::Object::' . ucfirst($type); | |||||||||
| 25 | 0 | push @ret, $class->new( mode => oct $mode, | |||||||||
| 26 | type => $type, | ||||||||||
| 27 | sha1 => $object, | ||||||||||
| 28 | file => $file, | ||||||||||
| 29 | repository => $self->repository, | ||||||||||
| 30 | ); | ||||||||||
| 31 | } | ||||||||||
| 32 | 0 | return \@ret; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | method entries { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
Subroutine
entries: not called CC=2 SCAR=12.4
Branch: 1 branch
| |||||||||||
| 36 | 0 | return $self->{_gpp_obj}->{directory_entries}; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 2 | 1; | |||||||||
| 40 | |||||||||||
| 41 | __END__ | ||||||||||