From 2dbaa4d12ec66a9328ba30c1bdcbf2634b97ec1b Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Wed, 26 Sep 2012 14:58:56 +0530 Subject: [PATCH] (minor) move a small chunk of code out of a loop --- src/lib/Gitolite/Conf/Store.pm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib/Gitolite/Conf/Store.pm b/src/lib/Gitolite/Conf/Store.pm index c77cac3..4d1c642 100644 --- a/src/lib/Gitolite/Conf/Store.pm +++ b/src/lib/Gitolite/Conf/Store.pm @@ -63,12 +63,20 @@ sub add_to_group { } sub set_repolist { - @repolist = @_; + @repolist = (); # ...sanity checks - for (@repolist) { + for (@_) { + if ( check_subconf_repo_disallowed( $subconf, $_ ) ) { + (my $repo = $_) =~ s/^\@$subconf\./locally modified \@/; + $ignored{$subconf}{$repo} = 1; + next; + } + _warn "explicit '.git' extension ignored for $_.git" if s/\.git$//; _die "bad reponame '$_'" if $_ !~ $REPOPATT_PATT; + + push @repolist, $_; } } @@ -103,13 +111,6 @@ sub add_rule { $nextseq++; for my $repo (@repolist) { - if ( check_subconf_repo_disallowed( $subconf, $repo ) ) { - my $repo = $repo; - $repo =~ s/^\@$subconf\./locally modified \@/; - $ignored{$subconf}{$repo} = 1; - next; - } - push @{ $repos{$repo}{$user} }, [ $nextseq, $perm, $ref ]; } }