X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit%2FCommand.pm;h=ce7bac636286209211361447e730dd3306fc045e;hb=308f8d7bc585e1106eb77d183c6e74ab130e0ded;hp=b32095f8a581302093aacf6f0414123648e350e7;hpb=19bee8f647bfe6c94c5cb3cf6a60d7a43cbca222;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit/Command.pm b/lib/App/Rgit/Command.pm index b32095f..ce7bac6 100644 --- a/lib/App/Rgit/Command.pm +++ b/lib/App/Rgit/Command.pm @@ -42,19 +42,17 @@ __PACKAGE__->action($_ => 'Once') for qw/version help daemon init/, ' '; sub new { my ($class, %args) = &validate; my $cmd = $args{cmd}; - return unless defined $cmd; + $cmd = ' ' unless defined $cmd; my $action = $class->action($cmd); 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}; eval "require $action; 1" or croak "Couldn't load $action: $@"; my $r = App::Rgit::Repository->new(fake => 1); return unless defined $r; $action->SUPER::new( cmd => $cmd, args => $args{args} || [ ], - repos => \@repos, + repos => $args{repos}, cwd_as_repo => $r, ); }