line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
250061
|
use 5.006; # our |
|
10
|
|
|
|
|
31
|
|
2
|
10
|
|
|
10
|
|
55
|
use strict; |
|
10
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
277
|
|
3
|
10
|
|
|
10
|
|
45
|
use warnings; |
|
10
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
891
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Git::Wrapper::Plus::Tester; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.004011'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Utility for testing things with a git repository |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
10
|
|
|
10
|
|
5849
|
use Moo qw( has ); |
|
10
|
|
|
|
|
146165
|
|
|
10
|
|
|
|
|
59
|
|
14
|
10
|
|
|
10
|
|
24624
|
use Path::Tiny qw(path); |
|
10
|
|
|
|
|
113069
|
|
|
10
|
|
|
|
|
4370
|
|
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
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
has 'temp_dir' => ( is => ro =>, lazy => 1, builder => 1 ); |
88
|
|
|
|
|
|
|
has 'home_dir' => ( is => ro =>, lazy => 1, builder => 1 ); |
89
|
|
|
|
|
|
|
has 'repo_dir' => ( is => ro =>, lazy => 1, builder => 1 ); |
90
|
|
|
|
|
|
|
has 'git' => ( is => ro =>, lazy => 1, builder => 1 ); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
has 'committer_name' => ( is => ro =>, lazy => 1, builder => 1 ); |
111
|
|
|
|
|
|
|
has 'committer_email' => ( is => ro =>, lazy => 1, builder => 1 ); |
112
|
|
|
|
|
|
|
has 'author_name' => ( is => ro =>, lazy => 1, builder => 1 ); |
113
|
|
|
|
|
|
|
has 'author_email' => ( is => ro =>, lazy => 1, builder => 1 ); |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub _build_temp_dir { |
116
|
9
|
|
|
9
|
|
154
|
return Path::Tiny->tempdir; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub _build_home_dir { |
120
|
9
|
|
|
9
|
|
79
|
my ( $self, ) = @_; |
121
|
9
|
|
|
|
|
143
|
my $d = $self->temp_dir->child('homedir'); |
122
|
9
|
|
|
|
|
248
|
$d->mkpath; |
123
|
9
|
|
|
|
|
1174
|
return $d; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub _build_repo_dir { |
127
|
9
|
|
|
9
|
|
179
|
my ( $self, ) = @_; |
128
|
9
|
|
|
|
|
173
|
my $d = $self->temp_dir->child('repodir'); |
129
|
9
|
|
|
|
|
6177
|
$d->mkpath; |
130
|
9
|
|
|
|
|
1729
|
return $d; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub _build_git { |
134
|
9
|
|
|
9
|
|
13204
|
my ( $self, ) = @_; |
135
|
9
|
|
|
|
|
4995
|
require Git::Wrapper; |
136
|
9
|
|
|
|
|
232042
|
return Git::Wrapper->new( $self->repo_dir->absolute->stringify ); |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub _build_committer_name { |
140
|
9
|
|
|
9
|
|
130
|
return 'A. U. Thor'; |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub _build_committer_email { |
144
|
9
|
|
|
9
|
|
120
|
return 'author@example.org'; |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub _build_author_name { |
148
|
9
|
|
|
9
|
|
81
|
my ( $self, ) = @_; |
149
|
9
|
|
|
|
|
173
|
return $self->committer_name; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub _build_author_email { |
153
|
9
|
|
|
9
|
|
65
|
my ( $self, ) = @_; |
154
|
9
|
|
|
|
|
149
|
return $self->committer_email; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub run_env { |
170
|
9
|
|
|
9
|
1
|
10703
|
my ( $self, $code ) = @_; |
171
|
9
|
|
|
|
|
215
|
local $ENV{HOME} = $self->home_dir->absolute->stringify; |
172
|
9
|
|
|
|
|
479
|
local $ENV{GIT_AUTHOR_NAME} = $self->author_name; |
173
|
9
|
|
|
|
|
155
|
local $ENV{GIT_AUTHOR_EMAIL} = $self->author_email; |
174
|
9
|
|
|
|
|
134
|
local $ENV{GIT_COMMITTER_NAME} = $self->committer_name; |
175
|
9
|
|
|
|
|
186
|
local $ENV{GIT_COMMITTER_EMAIL} = $self->committer_email; |
176
|
9
|
|
|
|
|
77
|
return $code->( $self, ); |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
10
|
|
|
10
|
|
79
|
no Moo; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
62
|
|
180
|
|
|
|
|
|
|
1; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
__END__ |