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