line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1330
|
use 5.008; # utf8 |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
105
|
|
2
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
85
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
82
|
|
4
|
2
|
|
|
2
|
|
1111
|
use utf8; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
27
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Git::Wrapper::Plus::Ref::Branch; |
7
|
|
|
|
|
|
|
$Git::Wrapper::Plus::Ref::Branch::VERSION = '0.004010'; |
8
|
|
|
|
|
|
|
# ABSTRACT: A Branch object |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
|
1206
|
use Moo qw( extends ); |
|
2
|
|
|
|
|
21472
|
|
|
2
|
|
|
|
|
18
|
|
40
|
|
|
|
|
|
|
extends 'Git::Wrapper::Plus::Ref'; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
our @CARP_NOT; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
## no critic (ProhibitMixedCaseSubs) |
53
|
|
|
|
|
|
|
sub new_from_Ref { |
54
|
7
|
|
|
7
|
1
|
15
|
my ( $class, $source_object ) = @_; |
55
|
7
|
50
|
|
|
|
35
|
if ( not $source_object->can('name') ) { |
56
|
0
|
|
|
|
|
0
|
require Carp; |
57
|
0
|
|
|
|
|
0
|
return Carp::croak("Object $source_object does not respond to ->name, cannot Ref -> Branch"); |
58
|
|
|
|
|
|
|
} |
59
|
7
|
|
|
|
|
27
|
my $name = $source_object->name; |
60
|
|
|
|
|
|
|
## no critic ( Compatibility::PerlMinimumVersionAndWhy ) |
61
|
7
|
50
|
|
|
|
83
|
if ( $name =~ qr{\Arefs/heads/(.+\z)}msx ) { |
62
|
7
|
|
|
|
|
215
|
return $class->new( |
63
|
|
|
|
|
|
|
git => $source_object->git, |
64
|
|
|
|
|
|
|
name => $1, |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
} |
67
|
0
|
|
|
|
|
0
|
require Carp; |
68
|
0
|
|
|
|
|
0
|
Carp::croak("Path $name is not in refs/heads/*, cannot convert to Branch object"); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub refname { |
78
|
2
|
|
|
2
|
1
|
7
|
my ($self) = @_; |
79
|
2
|
|
|
|
|
21
|
return 'refs/heads/' . $self->name; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
## no critic (ProhibitBuiltinHomonyms) |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub delete { |
101
|
0
|
|
|
0
|
1
|
|
my ( $self, $params ) = @_; |
102
|
0
|
0
|
|
|
|
|
if ( $params->{force} ) { |
103
|
0
|
|
|
|
|
|
return $self->git->branch( '-D', $self->name ); |
104
|
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
|
return $self->git->branch( '-d', $self->name ); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub move { |
120
|
0
|
|
|
0
|
1
|
|
my ( $self, $new_name, $params ) = @_; |
121
|
0
|
0
|
0
|
|
|
|
if ( not defined $new_name or not length $new_name ) { |
122
|
0
|
|
|
|
|
|
require Carp; |
123
|
|
|
|
|
|
|
## no critic (ProhibitLocalVars) |
124
|
0
|
|
|
|
|
|
local @CARP_NOT = __PACKAGE__; |
125
|
0
|
|
|
|
|
|
Carp::croak(q[Move requires a defined argument to move to, with length >= 1 ]); |
126
|
|
|
|
|
|
|
} |
127
|
0
|
0
|
|
|
|
|
if ( $params->{force} ) { |
128
|
0
|
|
|
|
|
|
return $self->git->branch( '-M', $self->name, $new_name ); |
129
|
|
|
|
|
|
|
} |
130
|
0
|
|
|
|
|
|
return $self->git->branch( '-m', $self->name, $new_name ); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
2
|
|
|
2
|
|
3908
|
no Moo; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
21
|
|
134
|
|
|
|
|
|
|
1; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
__END__ |