line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minilla::Release::CheckReleaseBranch; |
2
|
1
|
|
|
1
|
|
1114
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
21
|
use Minilla::Logger; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
175
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub run { |
8
|
0
|
|
|
0
|
0
|
|
my ($self, $project, $opts) = @_; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# The checking only performs when the config explicitly sets the release branch. |
11
|
|
|
|
|
|
|
# That's why we don't use "$project->release_branch". |
12
|
0
|
|
|
|
|
|
my $release_branch = $project->config->{release}->{branch}; |
13
|
0
|
0
|
|
|
|
|
return unless $release_branch; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $current_branch = `git rev-parse --abbrev-ref HEAD`; |
16
|
0
|
|
|
|
|
|
chomp $current_branch; |
17
|
0
|
0
|
|
|
|
|
unless ($current_branch eq $release_branch) { |
18
|
0
|
|
|
|
|
|
errorf("Release branch must be $release_branch.\n"); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|