From e922dfb939b051a03c34047f2f92bde1245932f6 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 16 Nov 2009 20:05:08 +0530 Subject: [PATCH] compile: allow PATH/foo and populate the hash correctly --- src/gl-compile-conf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gl-compile-conf b/src/gl-compile-conf index e307e2b..3f1e231 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -194,9 +194,9 @@ sub parse_conf_file # if no ref is given, this PERM applies to all refs @refs = qw(refs/.*) unless @refs; - # fully qualify refs that dont start with "refs/"; prefix them with - # "refs/heads/" - @refs = map { m(^refs/) or s(^)(refs/heads/); $_ } @refs; + # fully qualify refs that dont start with "refs/" or "PATH/"; + # prefix them with "refs/heads/" + @refs = map { m(^(refs|PATH)/) or s(^)(refs/heads/); $_ } @refs; # expand the user list, unless it is just "@all" @users = expand_list ( @users ) @@ -233,6 +233,13 @@ sub parse_conf_file # for 2nd level check, store each "ref, perms" pair in order for my $ref (@refs) { + # checking PATH based restrictions is expensive for + # the update hook (see the changes to src/hooks/update + # in this commit for why) so we would *very* much like + # to avoid doing it for the large majority of repos + # that do *not* use PATH limits. Setting a flag that + # can be checked right away will help us do that + $repos{$repo}{PATH_LIMITS} = 1 if $ref =~ /^PATH\//; push @{ $repos{$repo}{$user} }, { $ref => $perms } unless $rurp_seen{$repo}{$user}{$ref}{$perms}++; }