line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Determine the version of a system under test via git for upload to elasticsearch |
2
|
|
|
|
|
|
|
# PODNAME: App::Prove::Elasticsearch::Versioner::Git |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package App::Prove::Elasticsearch::Versioner::Git; |
5
|
|
|
|
|
|
|
$App::Prove::Elasticsearch::Versioner::Git::VERSION = '0.001'; |
6
|
1
|
|
|
1
|
|
80308
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
21
|
|
7
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
8
|
1
|
|
|
1
|
|
476
|
use utf8; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
461
|
use Git; |
|
1
|
|
|
|
|
18098
|
|
|
1
|
|
|
|
|
137
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub get_version { |
13
|
1
|
|
|
1
|
1
|
99
|
my $out = Git::command_oneline('log', '--format=format:%H'); |
14
|
1
|
|
|
|
|
6
|
my @shas = split(/\n/, $out); |
15
|
1
|
|
|
|
|
5
|
return shift(@shas); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub get_file_version { |
19
|
1
|
|
|
1
|
1
|
643
|
my $input = shift; |
20
|
1
|
|
|
|
|
3
|
my $out = |
21
|
|
|
|
|
|
|
Git::command_oneline('log', '--format=format:%H', '--follow', $input); |
22
|
1
|
|
|
|
|
7
|
my @shas = split(/\n/, $out); |
23
|
1
|
|
|
|
|
9
|
return shift(@shas); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |