compile/update-hook: preserve the order of refs

...by turning the last piece (list of allowed refs) into an array rather than a hash
This commit is contained in:
Sitaram Chamarty 2009-08-24 10:16:25 +05:30
parent 6feffc9b16
commit 3cddc4ca35
2 changed files with 2 additions and 5 deletions

View file

@ -204,10 +204,7 @@ while (<INF>)
{
for my $user (@users)
{
for my $ref (@refs)
{
$repos{$repo}{$perm}{$user}{$ref} = 1;
}
push @{ $repos{$repo}{$perm}{$user} }, @refs;
}
}
}

View file

@ -69,7 +69,7 @@ $perm = '+' if $ref =~ m(refs/tags/) and $oldsha ne ('0' x 40);
$perm = '+' if $ref =~ m(refs/heads/) and $oldsha ne $merge_base;
my $allowed_refs = $repos{$ENV{GL_REPO}}{$perm}{$ENV{GL_USER}};
for my $refex (keys %$allowed_refs)
for my $refex (@$allowed_refs)
# refex? sure -- a regex to match a ref against :)
{
if ($ref =~ /$refex/)