From: Vincent Pit Date: Tue, 23 Feb 2010 14:36:17 +0000 (+0100) Subject: Stop looking for repositories inside repositories X-Git-Tag: v0.07~23 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4aef5e093a78f0f437e835f129a32e66e78e23e5;p=perl%2Fmodules%2Frgit.git Stop looking for repositories inside repositories --- diff --git a/bin/rgit b/bin/rgit index 6e5c3d2..1ee1158 100755 --- a/bin/rgit +++ b/bin/rgit @@ -89,6 +89,8 @@ Version 0.06 =head1 DESCRIPTION This utility recursively searches in a root directory (which may be the current working directory or - if it has been set - the directory given by the C environment variable) for all git repositories, sort this list by the repository path, C into each of them, and executes the specified git command. +For efficiency reasons, repositories located inside another repository won't be searched for. + Moreover, those formats are substituted in the arguments before running the command : =over 4 diff --git a/lib/App/Rgit/Config/Default.pm b/lib/App/Rgit/Config/Default.pm index 028e106..cd2160b 100644 --- a/lib/App/Rgit/Config/Default.pm +++ b/lib/App/Rgit/Config/Default.pm @@ -45,9 +45,10 @@ sub repos { wanted => sub { 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}; + if (my $r = App::Rgit::Repository->new(dir => $_)) { + $File::Find::prune = 1; + $repos{$r->repo} = $r unless exists $repos{$r->repo}; + } }, follow => 1, no_chdir => 1,