Skip to content

Commit

Permalink
(minor) move a small chunk of code out of a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sitaramc committed Sep 26, 2012
1 parent 6328ec2 commit 2dbaa4d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/lib/Gitolite/Conf/Store.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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, $_;
}
}

Expand Down Expand Up @@ -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 ];
}
}
Expand Down

0 comments on commit 2dbaa4d

Please sign in to comment.