line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Class::Role::Clone; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
1979
|
use Moo::Role; with 'Git::Class::Role::Execute'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
17
|
|
4
|
|
|
|
|
|
|
requires 'git'; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
2360
|
use Git::Class::Worktree; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
138
|
|
7
|
3
|
|
|
3
|
|
3357
|
use URI::Escape; |
|
3
|
|
|
|
|
4665
|
|
|
3
|
|
|
|
|
726
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub clone { |
10
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my ($options, @args) = $self->_get_options(@_); |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my ($out) = $self->git( clone => $options, @args ); |
15
|
0
|
0
|
|
|
|
|
Carp::croak $self->_error if $self->_error; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $dir = $args[-1]; |
18
|
0
|
0
|
|
|
|
|
if ($dir =~ m{([^/]+)/?\.git/?$}i) { |
19
|
0
|
|
|
|
|
|
$dir = uri_unescape($1); |
20
|
|
|
|
|
|
|
} |
21
|
0
|
0
|
|
|
|
|
$self->_error("work directory is not found") unless -d $dir; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
Git::Class::Worktree->new( path => $dir, cmd => $self ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |