line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
1312
|
use 5.008; # utf8 |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
166
|
|
2
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
127
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
114
|
|
4
|
4
|
|
|
4
|
|
1060
|
use utf8; |
|
4
|
|
|
|
|
74
|
|
|
4
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Git::Wrapper::Plus::Util; |
7
|
|
|
|
|
|
|
$Git::Wrapper::Plus::Util::VERSION = '0.004010'; |
8
|
|
|
|
|
|
|
# ABSTRACT: Misc plumbing tools for Git::Wrapper::Plus |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
66
|
use Sub::Exporter::Progressive -setup => { |
13
|
|
|
|
|
|
|
exports => [qw( exit_status_handler )], |
14
|
|
|
|
|
|
|
groups => { |
15
|
|
|
|
|
|
|
default => [qw( exit_status_handler )], |
16
|
|
|
|
|
|
|
}, |
17
|
4
|
|
|
4
|
|
1298
|
}; |
|
4
|
|
|
|
|
1227
|
|
18
|
|
|
|
|
|
|
|
19
|
4
|
|
|
4
|
|
3488
|
use Try::Tiny qw( try catch ); |
|
4
|
|
|
|
|
3623
|
|
|
4
|
|
|
|
|
318
|
|
20
|
4
|
|
|
4
|
|
24
|
use Scalar::Util qw(blessed); |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
1276
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub exit_status_handler { |
55
|
2
|
|
|
2
|
1
|
1133
|
my ( $callback, $status_map ) = @_; |
56
|
2
|
|
|
|
|
7
|
my $return = 1; |
57
|
|
|
|
|
|
|
try { |
58
|
2
|
|
|
2
|
|
98
|
$callback->(); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
catch { |
61
|
|
|
|
|
|
|
## no critic (ErrorHandling::RequireUseOfExceptions) |
62
|
1
|
|
|
1
|
|
7726
|
undef $return; |
63
|
1
|
50
|
|
|
|
19
|
if ( not ref $_ ) { |
64
|
0
|
|
|
|
|
0
|
die $_; |
65
|
|
|
|
|
|
|
} |
66
|
1
|
50
|
|
|
|
25
|
if ( not blessed $_ ) { |
67
|
0
|
|
|
|
|
0
|
die $_; |
68
|
|
|
|
|
|
|
} |
69
|
1
|
50
|
|
|
|
34
|
if ( not $_->isa('Git::Wrapper::Exception') ) { |
70
|
0
|
|
|
|
|
0
|
die $_; |
71
|
|
|
|
|
|
|
} |
72
|
1
|
|
|
|
|
5
|
for my $status ( sort keys %{$status_map} ) { |
|
1
|
|
|
|
|
8
|
|
73
|
1
|
50
|
|
|
|
6
|
if ( $status == $_->status ) { |
74
|
1
|
|
|
|
|
59
|
$return = $status_map->{$status}->($_); |
75
|
1
|
|
|
|
|
27
|
return; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
0
|
|
|
|
|
0
|
die $_; |
79
|
2
|
|
|
|
|
43
|
}; |
80
|
2
|
100
|
|
|
|
14970
|
return 1 if $return; |
81
|
1
|
|
|
|
|
21
|
return; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |