Patch/Command/Squash.pm

filter: Statementstmt 80.0% 24 / 30 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 1 totaltotal 73.1% 30 / 41 CC 4 SCAR 15.9
CC
4
Cov
75%
run
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 4.9
« Patch/Release.pm ↑ Summary Patch/Role/Patch.pm »
1 package Git::CPAN::Patch::Command::Squash;
2 1 our $AUTHORITY = 'cpan:YANICK';
3 #ABSTRACT: Combine multiple commits into one patch
4 1 $Git::CPAN::Patch::Command::Squash::VERSION = '2.5.2';
5 1 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Git::Repository;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use MooseX::App::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 with 'Git::CPAN::Patch::Role::Git';
15  
16 1 ▶use experimental qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
17 signatures
18 postderef
19 1 /;
20  
21 1 has first_arg => (
22 is => 'ro',
23 isa => 'Str',
24 required => 0,
25 );
26  
27 has branch => (
28 is => 'ro',
29 isa => 'Str',
30 lazy => 1,
31 0 ▶ default => sub ($self) {
Subroutine __ANON__: not called CC=2 SCAR=17.9
32 0 ▶ $self->first_arg || 'patch';
Branch: 1 branch
BranchTrueFalseTotal
$self->first_arg or "patch" 0 0 0
33 },
34 1 );
35  
36 0 ▶sub run ($self) {
Subroutine run: not called CC=3 SCAR=24.8
Pod undocumented
37 0 my $head = $self->git_run("rev-parse", "--verify", "HEAD");
38  
39 0 say for $self->git_run("checkout", "-b", $self->branch, "cpan/master");
40  
41 0 say for $self->git_run("merge", "--squash", $head);
42  
43 0 say "";
44  
45 0 say "Changes squashed onto working directory, commit and run git-cpan send_patch";
46 }
47  
48 1 __PACKAGE__->meta->make_immutable;
49  
50 1 1;
51  
52 __END__
« Patch/Release.pm ↑ Summary Patch/Role/Patch.pm »