Branch Coverage

blib/lib/CPAN/InGit.pm
Criterion Covered Total %
branch 22 108 20.3


line true false branch
20 0 5 if @list == 1
22 4 1 if defined $args->{'repo'}
32 0 0 if $self->git_repo->is_bare or $self->git_repo->is_head_detached
43 5 0 if builtin::blessed($thing) and $thing->isa("Git::Raw::Repository")
50 0 4 unless $tree
52 4 0 $origin && ref($origin)->isa('Git::Raw::Branch') ? :
60 0 4 if ($use_workdir) { }
62 0 0 unless $ent
66 0 4 unless $ent
70 0 4 $cfg->{'upstream_url'} ? :
81 0 1 if "Git::Raw::Branch"->lookup($self->git_repo, $name, 1)
83 0 1 if "Git::Raw::Branch"->lookup($self->git_repo, $name, 0)
86 0 1 if ($params{'upstream_url'}) { }
102 0 9 unless defined $branch_or_tag_or_id
104 0 9 if (builtin::blessed($branch_or_tag_or_id) and $branch_or_tag_or_id->isa('Git::Raw::Branch') || $branch_or_tag_or_id->isa('Git::Raw::Tag')) { }
0 9 elsif ($branch_or_tag_or_id eq 'HEAD') { }
9 0 elsif ($origin = eval { do { 'Git::Raw::Branch'->lookup($repo, $branch_or_tag_or_id, 1) } }) { }
0 0 elsif ($origin = eval { do { 'Git::Raw::Tag'->lookup($repo, $branch_or_tag_or_id) } }) { }
0 0 elsif (my $obj = eval { do { $repo->lookup($branch_or_tag_or_id) } }) { }
112 0 0 $repo->is_head_detached ? :
119 0 0 if ($obj->type == Git::Raw::Object::COMMIT()) { }
0 0 elsif ($obj->type == Git::Raw::Object::TREE()) { }
0 0 elsif ($obj->type == Git::Raw::Object::TAG()) { }
129 4 5 wantarray ? :
134 0 1 unless ($tree->can("entries"))
136 0 0 unless $tree = "Git::Raw::Tree"->lookup($self->git_repo, $id)
144 1 0 if ($dirent->type == Git::Raw::Object::BLOB()) { }
0 0 elsif ($dirent->type == Git::Raw::Object::TREE()) { }
146 0 1 unless my $blob = "Git::Raw::Blob"->lookup($self->git_repo, $dirent->id)
149 0 1 if (($mode & 61440) == 40960) { }
187 0 0 if ($file_path =~ /\.(tar\.gz|tar\.bz2|tgz)\z/u) { }
190 0 0 unless $tmp->print($$file_data)
196 0 0 unless (@files)
203 0 0 if (substr($_->name, 0, length $prefix) ne $prefix)
212 0 0 if (my $meta_json = $files{'META.json'})
213 0 0 unless eval { do { my $cm = "CPAN::Meta"->load_json_string($meta_json->get_content); $meta = $cm->as_struct({"version", 2}) } }
219 0 0 if (not $meta and my $meta_yml = $files{'META.yml'})
220 0 0 unless eval { do { my $cm = "CPAN::Meta"->load_yaml_string($meta_yml->get_content); $meta = $cm->as_struct({"version", 2}) } }
228 0 0 unless ($meta->{'provides'})
231 0 0 unless eval { do { die unless open my $pm_fh, "<", $files{$pm_fname}->get_content_by_ref; my $mm = "Module::Metadata"->new_from_handle($pm_fh, $pm_fname); foreach my $pkg (grep(($_ ne "main"), $mm->name, $mm->packages_inside)) { $provides->{$pkg}{'file'} = $pm_fname; $provides->{$pkg}{'version'} //= $mm->version($pkg); } ; 1 } }
232 0 0 unless open my $pm_fh, "<", $files{$pm_fname}->get_content_by_ref
243 0 0 if ($extract) { }
246 0 0 if (S_ISREG($mode)) { }
0 0 elsif (S_ISLNK($mode)) { }
0 0 elsif (not S_ISDIR($mode)) { }
248 0 0 $mode & 1 ? :
302 0 0 unless (eval { do { die "Unsupported cpanfile.snapshot version\n" unless /^# carton snapshot format: version 1.0\r?\n/cgmu; die "expected DISTRIBUTIONS\n" unless /\GDISTRIBUTIONS\r?\n/cgu; while (length $_ > pos $_) { die "expected dist name\n" unless my($dist_name) = /\G (\S+)\r?\n/cgu; my $dist = ($distributions{$dist_name} = {}); while (/\G (\w[^\r\n:]*): *(.*?)\r?\n/cgu) { my($attr, $val) = ($1, $2); if (length $val) { $dist->{$attr} = $val; } else { while (/\G (.*)\r?\n/cgu) { push @{$$dist{$attr};}, $1; } ; } ; die "Unexpected sub-element of $dist_name $attr\n" if /\G /cgu; } ; die "Unexpected sub-element of $dist_name\n" if /\G /cgu; foreach $_ ("provides", "requirements") { if (ref $dist->{$_} eq "ARRAY") { $dist->{$_} = {map((split(' ', $_, 0))[0, 1], @{$$dist{$_};})}; } ; } ; } ; 1 } })
303 0 0 unless /^# carton snapshot format: version 1.0\r?\n/cgmu
305 0 0 unless /\GDISTRIBUTIONS\r?\n/cgu
308 0 0 unless my($dist_name) = /\G (\S+)\r?\n/cgu
313 0 0 if (length $val) { }
320 0 0 if /\G /cgu
323 0 0 if /\G /cgu
327 0 0 if (ref $dist->{$_} eq "ARRAY")