add -prune to find commands

Apparently it makes a huge difference with some kinds of network drives
(guess which company's software ;-)

http://groups.google.com/group/gitolite/browse_thread/thread/66b888f11dc5a365
This commit is contained in:
Sitaram Chamarty 2011-01-28 04:40:29 +05:30
parent dab35f3565
commit 1fce051ea1
3 changed files with 4 additions and 4 deletions

View file

@ -146,7 +146,7 @@ sub list_phy_repos
my @phy_repos;
wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
for my $repo (`find . -type d -name "*.git"`) {
for my $repo (`find . -type d -name "*.git" -prune`) {
chomp ($repo);
$repo =~ s(\./(.*)\.git$)($1);
push @phy_repos, $repo;
@ -538,7 +538,7 @@ sub expand_wild
chdir("$ENV{GL_REPO_BASE_ABS}") or die "chdir $ENV{GL_REPO_BASE_ABS} failed: $!\n";
my $count = 0;
for my $actual_repo (`find . -type d -name "*.git"|sort`) {
for my $actual_repo (`find . -type d -name "*.git" -prune|sort`) {
chomp ($actual_repo);
$actual_repo =~ s/^\.\///;
$actual_repo =~ s/\.git$//;

View file

@ -94,7 +94,7 @@ EOF
# finally, hooks must be propagated to all the repos in case they changed
chdir("$ENV{GL_REPO_BASE_ABS}") or die "chdir $ENV{GL_REPO_BASE_ABS} failed: $!\n";
for my $repo (`find . -type d -name "*.git"`) {
for my $repo (`find . -type d -name "*.git" -prune`) {
chomp ($repo);
# propagate our own, plus any local admin-defined, hooks
ln_sf("$GL_ADMINDIR/hooks/common", "*", "$repo/hooks");

View file

@ -14,7 +14,7 @@ ssh $mirror cat \$HOME/.gitolite.rc | expand | egrep '^ *\$GL_SLAVE_MODE *= *1;
exit 1;
}
find . -type d -name "*.git" | cut -c3- | sort | while read r
find . -type d -name "*.git" -prune | cut -c3- | sort | while read r
do
cd $HOME; cd $REPO_BASE; cd $r
printf "$r "