]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit/Command.pm
Throughly test App::Rgit::Command::action
[perl/modules/rgit.git] / lib / App / Rgit / Command.pm
index 3754d83363bfc3af04a5e703f456c700e3f92ba5..203041439d6e175db61a16127720b32975e917a4 100644 (file)
@@ -70,9 +70,10 @@ Otherwise, returns the current class for C<$cmd>.
 
 sub action {
  my ($self, $cmd, $pkg) = @_;
- $cmd = $self->cmd if !defined $cmd
-                   and defined $self and $self->isa(__PACKAGE__);
- return unless defined $cmd;
+ if (not defined $cmd) {
+  return unless defined $self and ref $self and $self->isa(__PACKAGE__);
+  $cmd = $self->cmd;
+ }
  unless (defined $pkg) {
   return __PACKAGE__ . '::Each' unless defined $commands{$cmd};
   return $commands{$cmd}