line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
427
|
use 5.006; # our |
|
4
|
|
|
|
|
9
|
|
2
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
67
|
|
3
|
4
|
|
|
4
|
|
10
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
265
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Git::Wrapper::Plus::Util; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.004011'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Misc plumbing tools for Git::Wrapper::Plus |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
|
|
46
|
use Sub::Exporter::Progressive -setup => { |
14
|
|
|
|
|
|
|
exports => [qw( exit_status_handler )], |
15
|
|
|
|
|
|
|
groups => { |
16
|
|
|
|
|
|
|
default => [qw( exit_status_handler )], |
17
|
|
|
|
|
|
|
}, |
18
|
4
|
|
|
4
|
|
448
|
}; |
|
4
|
|
|
|
|
823
|
|
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
4
|
|
1316
|
use Try::Tiny qw( try catch ); |
|
4
|
|
|
|
|
2549
|
|
|
4
|
|
|
|
|
234
|
|
21
|
4
|
|
|
4
|
|
17
|
use Scalar::Util qw(blessed); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1076
|
|
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
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub exit_status_handler { |
56
|
2
|
|
|
2
|
1
|
6
|
my ( $callback, $status_map ) = @_; |
57
|
2
|
|
|
|
|
31
|
my $return = 1; |
58
|
|
|
|
|
|
|
try { |
59
|
2
|
|
|
2
|
|
479
|
$callback->(); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
catch { |
62
|
|
|
|
|
|
|
## no critic (ErrorHandling::RequireUseOfExceptions) |
63
|
1
|
|
|
1
|
|
7084
|
undef $return; |
64
|
1
|
50
|
|
|
|
11
|
die $_ unless ref; |
65
|
1
|
50
|
|
|
|
10
|
die $_ unless blessed $_; |
66
|
1
|
50
|
|
|
|
24
|
die $_ unless $_->isa('Git::Wrapper::Exception'); |
67
|
1
|
|
|
|
|
5
|
for my $status ( sort keys %{$status_map} ) { |
|
1
|
|
|
|
|
9
|
|
68
|
1
|
50
|
|
|
|
7
|
if ( $status == $_->status ) { |
69
|
1
|
|
|
|
|
50
|
$return = $status_map->{$status}->($_); |
70
|
1
|
|
|
|
|
23
|
return; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
0
|
|
|
|
|
0
|
die $_; |
74
|
2
|
|
|
|
|
45
|
}; |
75
|
2
|
100
|
|
|
|
6408
|
return 1 if $return; |
76
|
1
|
|
|
|
|
26
|
return; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
__END__ |