]> git.vpit.fr Git - perl/modules/rgit.git/commitdiff
Store the repos as-is in the command object
authorVincent Pit <vince@profvince.com>
Sun, 5 Oct 2008 21:32:18 +0000 (23:32 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 5 Oct 2008 21:32:18 +0000 (23:32 +0200)
lib/App/Rgit/Command.pm

index 7410be77977afa88b94b165defe775c3b2b7982c..ce7bac636286209211361447e730dd3306fc045e 100644 (file)
@@ -46,15 +46,13 @@ sub new {
  my $action = $class->action($cmd);
  croak "Command $cmd shouldn't be executed as an $action"
                            unless $class eq __PACKAGE__ or $class->isa($action);
  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} || [ ],
  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,
  );
 }
   cwd_as_repo => $r,
  );
 }