]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit.pm
Don't store the repos in the command, so that no search happen for Once commands
[perl/modules/rgit.git] / lib / App / Rgit.pm
index d2fe602f4c6b41814da2f57792d7d80e7431f7f9..38e4c38ab289f8c7813a4c0143d03af80c10cf7d 100644 (file)
@@ -3,9 +3,6 @@ package App::Rgit;
 use strict;
 use warnings;
 
-use Cwd qw/abs_path/;
-use File::Spec::Functions qw/file_name_is_absolute/;
-
 use Object::Tiny qw/config command/;
 
 use App::Rgit::Command;
@@ -18,11 +15,11 @@ App::Rgit - Backend that supports the rgit utility.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.02
 
 =cut
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
 =head1 DESCRIPTION
 
@@ -40,21 +37,19 @@ Creates a new L<App::Rgit> object that's bound to execute the command C<$cmd> on
 
 sub new {
  my ($class, %args) = &validate;
- my $root = $args{root};
- return unless defined $root and -d $root;
- $root = abs_path $root unless file_name_is_absolute $root;
- return unless defined $args{git} and -x $args{git};
  my $config = App::Rgit::Config->new(
-  root => $root,
+  root => $args{root},
   git  => $args{git},
  );
+ return unless defined $config;
+ my $command = App::Rgit::Command->new(
+  cmd  => $args{cmd},
+  args => $args{args},
+ );
+ return unless defined $command;
  $class->SUPER::new(
   config  => $config,
-  command => App::Rgit::Command->new(
-   cmd   => $args{cmd},
-   args  => $args{args},
-   repos => $config->repos,
-  )
+  command => $command,
  );
 }