line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Flux; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
9903
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
147
|
|
4
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
120
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
3779
|
use Git::Repository; |
|
5
|
|
|
|
|
143831
|
|
|
5
|
|
|
|
|
36
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# common |
9
|
5
|
|
|
5
|
|
4575
|
use mixin 'Git::Flux::Utils'; |
|
5
|
|
|
|
|
3274
|
|
|
5
|
|
|
|
|
28
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# commands |
12
|
5
|
|
|
5
|
|
2247
|
use mixin 'Git::Flux::Command::init'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
64
|
|
13
|
5
|
|
|
5
|
|
1400
|
use mixin 'Git::Flux::Command::help'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
29
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.0_03'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
19
|
0
|
|
|
|
|
|
my %opts = @_; |
20
|
0
|
|
|
|
|
|
my $self = { |
21
|
|
|
|
|
|
|
dir => $opts{'dir'}, |
22
|
|
|
|
|
|
|
repo => $opts{'repo'}, |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# TODO: add variables here for prefix (origin, feature, etc.) |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
bless $self, $class; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub run { |
31
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
32
|
0
|
|
|
|
|
|
my ( $cmd, @opts ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# run help if no other cmd |
35
|
0
|
|
0
|
|
|
|
$cmd ||= $self->help(); |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
0
|
|
|
|
if ( not defined $self->{'repo'} and $cmd ne 'init' ) { |
38
|
|
|
|
|
|
|
# create the repo now |
39
|
0
|
|
|
|
|
|
$self->create_repo(); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$self->$cmd(@opts); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub create_repo { |
46
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
47
|
0
|
|
0
|
|
|
|
my $dir = $self->{'dir'} || '.'; |
48
|
0
|
|
|
|
|
|
$self->{'repo'} = Git::Repository->new( work_tree => $dir ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |