use base qw/App::Rgit::Command/;
+use App::Rgit::Utils qw/:codes/;
+
=head1 NAME
App::Rgit::Command::Each - Class for commands to execute for each repository.
my $self = shift;
my $conf = shift;
my $status = 0;
+ my $code;
for (@{$conf->repos}) {
$_->chdir or next;
$status = $_->run($conf, @{$self->args});
- last if $status;
+ $code = $self->report($conf, $_, $status) unless defined $code;
+ if ($code & REDO) {
+ undef $code; # Don't save it, that would be very dumb
+ redo;
+ }
+ last if $code & LAST;
+ undef $code unless $code & SAVE;
}
$conf->cwd_repo->chdir;
- return $status;
+ return wantarray ? ($status, $code) : $status;
}
=head1 SEE ALSO