line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
579197
|
use 5.008; # utf8 |
|
10
|
|
|
|
|
42
|
|
|
10
|
|
|
|
|
12591
|
|
2
|
10
|
|
|
10
|
|
84
|
use strict; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
376
|
|
3
|
10
|
|
|
10
|
|
54
|
use warnings; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
369
|
|
4
|
10
|
|
|
10
|
|
12600
|
use utf8; |
|
10
|
|
|
|
|
101
|
|
|
10
|
|
|
|
|
59
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Git::Wrapper::Plus::Tester; |
7
|
|
|
|
|
|
|
$Git::Wrapper::Plus::Tester::VERSION = '0.004010'; |
8
|
|
|
|
|
|
|
# ABSTRACT: Utility for testing things with a git repository |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
11
|
|
|
|
|
|
|
|
12
|
10
|
|
|
10
|
|
15194
|
use Moo qw( has ); |
|
10
|
|
|
|
|
280933
|
|
|
10
|
|
|
|
|
75
|
|
13
|
10
|
|
|
10
|
|
56394
|
use Path::Tiny qw(path); |
|
10
|
|
|
|
|
261689
|
|
|
10
|
|
|
|
|
7253
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
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|
|
|
|
|
|
has 'home_dir' => ( is => ro =>, lazy => 1, builder => 1 ); |
88
|
|
|
|
|
|
|
has 'repo_dir' => ( is => ro =>, lazy => 1, builder => 1 ); |
89
|
|
|
|
|
|
|
has 'git' => ( is => ro =>, lazy => 1, builder => 1 ); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
has 'committer_name' => ( is => ro =>, lazy => 1, builder => 1 ); |
110
|
|
|
|
|
|
|
has 'committer_email' => ( is => ro =>, lazy => 1, builder => 1 ); |
111
|
|
|
|
|
|
|
has 'author_name' => ( is => ro =>, lazy => 1, builder => 1 ); |
112
|
|
|
|
|
|
|
has 'author_email' => ( is => ro =>, lazy => 1, builder => 1 ); |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub _build_temp_dir { |
115
|
9
|
|
|
9
|
|
5192
|
return Path::Tiny->tempdir; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub _build_home_dir { |
119
|
9
|
|
|
9
|
|
5903
|
my ( $self, ) = @_; |
120
|
9
|
|
|
|
|
258
|
my $d = $self->temp_dir->child('homedir'); |
121
|
9
|
|
|
|
|
421
|
$d->mkpath; |
122
|
9
|
|
|
|
|
2730
|
return $d; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub _build_repo_dir { |
126
|
9
|
|
|
9
|
|
7371
|
my ( $self, ) = @_; |
127
|
9
|
|
|
|
|
63
|
my $d = $self->temp_dir->child('repodir'); |
128
|
9
|
|
|
|
|
12499
|
$d->mkpath; |
129
|
9
|
|
|
|
|
2654
|
return $d; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub _build_git { |
133
|
9
|
|
|
9
|
|
32150
|
my ( $self, ) = @_; |
134
|
9
|
|
|
|
|
13862
|
require Git::Wrapper; |
135
|
9
|
|
|
|
|
619100
|
return Git::Wrapper->new( $self->repo_dir->absolute->stringify ); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub _build_committer_name { |
139
|
9
|
|
|
9
|
|
10583
|
return 'A. U. Thor'; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub _build_committer_email { |
143
|
9
|
|
|
9
|
|
11555
|
return 'author@example.org'; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub _build_author_name { |
147
|
9
|
|
|
9
|
|
21062
|
my ( $self, ) = @_; |
148
|
9
|
|
|
|
|
62
|
return $self->committer_name; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub _build_author_email { |
152
|
9
|
|
|
9
|
|
4812
|
my ( $self, ) = @_; |
153
|
9
|
|
|
|
|
53
|
return $self->committer_email; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub run_env { |
169
|
9
|
|
|
9
|
1
|
19733
|
my ( $self, $code ) = @_; |
170
|
9
|
|
|
|
|
59
|
local $ENV{HOME} = $self->home_dir->absolute->stringify; |
171
|
9
|
|
|
|
|
448
|
local $ENV{GIT_AUTHOR_NAME} = $self->author_name; |
172
|
9
|
|
|
|
|
60
|
local $ENV{GIT_AUTHOR_EMAIL} = $self->author_email; |
173
|
9
|
|
|
|
|
603
|
local $ENV{GIT_COMMITTER_NAME} = $self->committer_name; |
174
|
9
|
|
|
|
|
343
|
local $ENV{GIT_COMMITTER_EMAIL} = $self->committer_email; |
175
|
9
|
|
|
|
|
151
|
return $code->( $self, ); |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
10
|
|
|
10
|
|
101
|
no Moo; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
90
|
|
179
|
|
|
|
|
|
|
1; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
__END__ |