]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit/Repository.pm
Get rid of validate()
[perl/modules/rgit.git] / lib / App / Rgit / Repository.pm
index fd19bab29210aafb9a0a518d845b1d782e047627..1d8d490c16ea6c6e84db0ade55e760612fa1bcbe 100644 (file)
@@ -14,8 +14,6 @@ BEGIN {
  *WIFSIGNALED = sub { shift() & 127 } unless eval { WIFSIGNALED(0); 1 };
 }
 
-use App::Rgit::Utils qw/validate/;
-
 =head1 NAME
 
 App::Rgit::Repository - Class representing a Git repository.
@@ -44,10 +42,15 @@ If the C<fake> option is passed, C<$dir> isn't checked to be a valid C<git> repo
 =cut
 
 sub new {
- my ($class, %args) = &validate;
+ my $class = shift;
+ $class = ref $class || $class;
+
+ my %args = @_;
+
  my $dir = $args{dir};
  $dir = abs_path $dir if defined $dir and not file_name_is_absolute $dir;
  $dir = cwd       unless defined $dir;
+
  my ($repo, $bare, $name, $work);
  if ($args{fake}) {
   $repo = $work = $dir;
@@ -77,6 +80,7 @@ sub new {
    $work = $repo;
   }
  }
+
  bless {
   fake => !!$args{fake},
   repo => $repo,