blib/lib/Git/Wrapper/Plus/Ref.pm

filter: Statementstmt 93.5% 29 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 93.0% 40 / 43 SCAR 6.9
CC
2
Cov
91%
sha1
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Git/Wrapper/Plus/Versions.pm ↑ Summary lib/Git/Wrapper/Plus/Support/Commands.pm »
1 7 ▶use 5.008; # utf8
Subroutine BEGIN: called CC=1 SCAR=0.0
2 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Git::Wrapper::Plus::Ref;
7 7 $Git::Wrapper::Plus::Ref::VERSION = '0.004010';
8 # ABSTRACT: An Abstract REF node
9  
10 7 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36 7 ▶use Moo qw( has );
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48 7 has 'name' => ( is => ro =>, required => 1 );
49 7 has 'git' => ( is => ro =>, required => 1 );
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63 sub refname {
64 6 ▶ my ($self) = @_;
Subroutine refname: called CC=1 SCAR=0.0
Pod documented
65 6 return $self->name;
66 }
67  
68  
69  
70  
71  
72  
73  
74 sub sha1 {
75 18 ▶ my ($self) = @_;
Subroutine sha1: called CC=2 SCAR=7.6
Pod documented
76 18 my ($refname) = $self->refname;
77 18 my (@sha1s) = $self->git->rev_parse($refname);
78 18 ▶ if ( scalar @sha1s > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @sha1s > 1) 0 18 18
79 0 require Carp;
80 0 return Carp::confess( q[Fatal: rev-parse ] . $refname . q[ returned multiple values] );
81 }
82 18 return shift @sha1s;
83 }
84  
85 7 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
86 7 1;
87  
88 __END__
« blib/lib/Git/Wrapper/Plus/Versions.pm ↑ Summary lib/Git/Wrapper/Plus/Support/Commands.pm »