]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit/Config/Default.pm
Don't chdir() when searching for git repositories
[perl/modules/rgit.git] / lib / App / Rgit / Config / Default.pm
index e34767b96ba7889db056a61d1f505e41f1a3a8e6..028e106a2302f351a47dd0e0393c1aa4fde4f70a 100644 (file)
@@ -15,11 +15,11 @@ App::Rgit::Config::Default - Default App::Rgit configuration class.
 
 =head1 VERSION
 
-Version 0.04
+Version 0.06
 
 =cut
 
-our $VERSION = '0.04';
+our $VERSION = '0.06';
 
 =head1 DESCRIPTION
 
@@ -43,12 +43,14 @@ sub repos {
  my %repos;
  find {
   wanted => sub {
-   return unless -d $_;
-   my $r = App::Rgit::Repository->new(dir => $File::Find::name);
-   $repos{$r->repo} = $r if $r 
+   return if m{(?:^|/)\.\.?$}
+          or not (-d $_ and -r _);
+   my $r = App::Rgit::Repository->new(dir => $_);
+   $repos{$r->repo} = $r if $r
                          and not exists $repos{$r->repo};
   },
-  follow => 1
+  follow   => 1,
+  no_chdir => 1,
  }, $self->root;
  $self->{repos} = [ sort { $a->repo cmp $b->repo } values %repos ];
 }
@@ -75,7 +77,7 @@ You can find documentation for this module with the perldoc command.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2008 Vincent Pit, all rights reserved.
+Copyright 2008-2009 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.