| 1 | package App::GitGot::Command::readd; | ||||||||||
| 2 | 16 | our $AUTHORITY = 'cpan:GENEHACK'; | |||||||||
| 3 | 16 | $App::GitGot::Command::readd::VERSION = '1.339'; | |||||||||
| 4 | # ABSTRACT: update config metadata to match repo | ||||||||||
| 5 | 16 | ▶ | use 5.014; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 16 | ▶ | use App::GitGot -command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 16 | ▶ | use App::GitGot::Repo::Git; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 16 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 16 | extends 'App::GitGot::Command'; | |||||||||
| 12 | 16 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub options { | ||||||||
|
Subroutine
options: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 15 | 0 | my( $class , $app ) = @_; | |||||||||
| 16 | 0 | return (); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub _use_io_page { 0 } | ||||||||
|
Subroutine
_use_io_page: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub _execute { | ||||||||
|
Subroutine
_execute: not called CC=6 SCAR=37.4
| |||||||||||
| 22 | 0 | my ( $self, $opt, $args ) = @_; | |||||||||
| 23 | |||||||||||
| 24 | 0 | my $max_len = $self->max_length_of_an_active_repo_label(); | |||||||||
| 25 | 0 | my $updated_config = 0; | |||||||||
| 26 | |||||||||||
| 27 | 0 | REPO: for my $repo ( $self->active_repos ) { | |||||||||
| 28 | 0 | ▶ | next unless $repo->type eq 'git'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | my $configuration_url = $repo->repo; | |||||||||
| 31 | 0 | my( $repo_url ) = $repo->config("remote.origin.url"); | |||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | if( $configuration_url ne $repo_url ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | # do as i say, not as i do... | ||||||||||
| 35 | 0 | $repo->{repo} = $repo_url; | |||||||||
| 36 | 0 | $updated_config = 1; | |||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | printf "Updated repo url for %-${max_len}s to %s\n", $repo->name, $repo->repo | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | if $self->verbose; | ||||||||||
| 40 | } | ||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | $self->write_config() | ||||||||||
| 44 | 0 | ▶ | if $updated_config; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 16 | 1; | |||||||||
| 48 | |||||||||||
| 49 | __END__ | ||||||||||