line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minilla::Release::CheckReleaseBranch; |
2
|
1
|
|
|
1
|
|
1025
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
4
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
1
|
|
|
1
|
|
19
|
use Minilla::Logger; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
179
|
|
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
|
|
|
|
|
|
|
|