Minilla/Release/CheckReleaseBranch.pm

filter: Statementstmt 65.0% 13 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 56.6% 17 / 30 CC 3 SCAR 17.4
CC
3
Cov
54%
run
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« Minilla/Gitignore.pm ↑ Summary Minilla/Release/CheckChanges.pm »
1 package Minilla::Release::CheckReleaseBranch;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Minilla::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub run {
Subroutine run: not called CC=3 SCAR=24.8
Pod undocumented
8 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 ▶ return unless $release_branch;
Branch: 1 branch
BranchTrueFalseTotal
unless $release_branch 0 0 0
14  
15 0 my $current_branch = `git rev-parse --abbrev-ref HEAD`;
16 0 chomp $current_branch;
17 0 ▶ unless ($current_branch eq $release_branch) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($current_branch eq $release_branch) 0 0 0
18 0 errorf("Release branch must be $release_branch.\n");
19 }
20 }
21  
22 1 1;
23  
« Minilla/Gitignore.pm ↑ Summary Minilla/Release/CheckChanges.pm »