- croak "Command $cmd shouldn't be executed as an $action"
- unless $class eq __PACKAGE__ or $class->isa($action);
- my @repos = grep $_->isa('App::Rgit::Repository'),
- ref $args{repos} eq 'ARRAY' ? @{$args{repos}} : $args{repos};
+ if ($class eq __PACKAGE__) {
+ $class = $action;
+ } else {
+ croak "Command $cmd should be executed as a $action"
+ unless $class->isa($action);
+ }