From a3f1258a0a0c6b4604d827f98baa5c09dbc431db Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 23 Mar 2010 14:59:33 +0530 Subject: [PATCH] reduce a bit of code duplication in check_access; make it call check_ref --- src/gitolite.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gitolite.pm b/src/gitolite.pm index 9c108a5..979ca51 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -394,13 +394,7 @@ sub check_access push @allowed_refs, @ { $repos{$repo}{$ENV{GL_USER}} || [] }; push @allowed_refs, @ { $repos{$repo}{'@all'} || [] }; - for my $ar (@allowed_refs) { - my $refex = (keys %$ar)[0]; - next unless $ref =~ /^$refex/; - die "$perm $ref $ENV{GL_USER} DENIED by $refex\n" if $ar->{$refex} eq '-'; - return if ($ar->{$refex} =~ /\Q$perm/); - } - die "$perm $ref $ENV{GL_REPO} $ENV{GL_USER} DENIED by fallthru\n"; + &check_ref(\@allowed_refs, $repo, $ref, $perm); } # ----------------------------------------------------------------------------