X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=blobdiff_plain;f=lib%2FApp%2FRgit%2FCommand.pm;h=203041439d6e175db61a16127720b32975e917a4;hp=3754d83363bfc3af04a5e703f456c700e3f92ba5;hb=3a19229d25523e535c5a79343d4a4d80e153e389;hpb=d2c0f4071b90c3b50696c5b7f9cc4ae341628f33 diff --git a/lib/App/Rgit/Command.pm b/lib/App/Rgit/Command.pm index 3754d83..2030414 100644 --- a/lib/App/Rgit/Command.pm +++ b/lib/App/Rgit/Command.pm @@ -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}