Flux/Command/feature.pm

filter: Statementstmt 37.0% 10 / 27 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 33.3% 15 / 45 CC 5 SCAR 28.5
CC
5
Cov
28%
feature_start
30.0
feature
2.0
BEGIN
1.0
CRAP 17.2
« Flux/Command/init.pm ↑ Summary Flux/Utils.pm »
1 package Git::Flux::Command::feature;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use mixin::with 'Git::Flux';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub feature {
Subroutine feature: not called CC=1 SCAR=6.9
Pod documented
8 0 my $self = shift;
9 0 my $cmd = shift;
10 0 my $method = "feature_$cmd";
11  
12 # dispatch to methods
13 0 $self->$method(@_);
14 }
15  
16 0 ▶sub feature_start {
Subroutine feature_start: not called CC=5 SCAR=34.0
Pod documented
17 0 my $self = shift;
18 0 my ( $br_name, $fetch ) = @_;
19 0 my $repo = $self->{'repo'};
20  
21 0 ▶ $br_name or die "Missing argument <name>\n";
Branch: 1 branch
BranchTrueFalseTotal
$br_name or die "Missing argument <name>\n" 0 0 0
22  
23 0 $self->require_branch_absent($br_name);
24  
25 # TODO: fetch flag handling
26  
27 # TODO: remove all hardcoding
28 0 my $devel_br = 'devel';
29 0 ▶ my $base = $fetch || $devel_br;
Condition0%0/3
$fetch || $devel_br
l!l&&r!l&&!r
000
MC/DC0%0/2
$fetch || $devel_br
$fetch $devel_br
Truth table0%0/3
A || B
A= $fetchB= $devel_br
ABresult
1X1
011
000
30  
31 # if remote exists, compare them
32 0 ▶ if ( $self->git_branch_exists("origin/$devel_br") ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->git_branch_exists("origin/$devel_br")) 0 0 0
33 0 $self->require_branches_equal( $devel_br, "origin/$devel_br" );
34 }
35  
36 # create branch
37 0 my $result = $repo->command( checkout => '-b', $br_name => $base );
38 0 $result->close();
39  
40 0 ▶ $result->exit == 0 or die "Could not create feature branch '$br_name'\n";
Branch: 1 branch
BranchTrueFalseTotal
$result->exit == 0 or die "Could not create feature branch '${br_name}'\n" 0 0 0
41  
42 0 print << "_END_REPORT";
43 Summary of actions:
44 - A new branch '$br_name' was created, based on '$base'
45 - You are now on branch '$br_name'
46  
47 Now, start committing on your feature. When done, use:
48  
49 git flow feature finish $br_name
50 _END_REPORT
51  
52 }
53  
54 2 1;
55  
56 __END__
« Flux/Command/init.pm ↑ Summary Flux/Utils.pm »