| 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
| |||||||||||||||||||||
| 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
MC/DC0%0/2
$fetch || $devel_br
$fetch
$devel_br
Truth table0%0/3
A || B
A= $fetchB= $devel_br
| |||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | # if remote exists, compare them | ||||||||||||||||||||
| 32 | 0 | ▶ | if ( $self->git_branch_exists("origin/$devel_br") ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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__ | ||||||||||||||||||||