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;
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;
$class->SUPER::new(
config => $config,
command => App::Rgit::Command->new(
use warnings;
use Carp qw/croak/;
+use Cwd qw/abs_path/;
+use File::Spec::Functions qw/file_name_is_absolute/;
use Object::Tiny qw/root git/;
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 $conf = 'App::Rgit::Config::Default';
eval "require $conf; 1" or croak "Couldn't load $conf: $@";
$conf->SUPER::new(