| 1 | package Git::CPAN::Patch::Command::Clone; | ||||||||||||||||||||
| 2 | 2 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||||||||||
| 3 | #ABSTRACT: Clone a CPAN module's history into a new git repository | ||||||||||||||||||||
| 4 | 2 | $Git::CPAN::Patch::Command::Clone::VERSION = '2.5.2'; | |||||||||||||||||||
| 5 | 2 | ▶ | use 5.20.0; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 2 | ▶ | use autodie; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 2 | ▶ | use Path::Tiny qw(path); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 2 | ▶ | use MooseX::App::Command; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | 2 | extends 'Git::CPAN::Patch::Command::Import'; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 2 | ▶ | use experimental 'signatures'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 2 | parameter target => ( | |||||||||||||||||||
| 19 | is => 'rw', | ||||||||||||||||||||
| 20 | isa => 'Str', | ||||||||||||||||||||
| 21 | required => 0, | ||||||||||||||||||||
| 22 | ); | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 2 | has _seen_imports => ( | |||||||||||||||||||
| 25 | is => 'rw', | ||||||||||||||||||||
| 26 | isa => 'Bool', | ||||||||||||||||||||
| 27 | default => 0, | ||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 0 | ▶ | before [ qw/import_release clone_git_repo /] => sub($self,$release,@) { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||
| 32 | 0 | ▶ | return if $self->_seen_imports; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 33 | 0 | $self->_set_seen_imports(1); | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | ▶ | my $target = $self->target || $release->dist_name; | ||||||||||||||||||
|
Condition0%0/3
$self->target || $release->dist_name
MC/DC0%0/2
$self->target || $release->dist_name
$self->target
$release->dist_name
Truth table0%0/3
A || B
A= $self->targetB= $release->dist_name
| |||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | say "creating $target"; | |||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 0 | path($target)->mkdir; | |||||||||||||||||||
| 40 | 0 | Git::Repository->run( init => $target ); | |||||||||||||||||||
| 41 | 0 | $self->set_root($target); | |||||||||||||||||||
| 42 | 2 | }; | |||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 0 | ▶ | after [ qw/ clone_git_repo import_release /] => sub($self,@) { | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 45 | 0 | $self->git_run( 'reset', '--hard', $self->last_commit ); | |||||||||||||||||||
| 46 | 2 | }; | |||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 2 | 1; | |||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||