From a10287a4cd2c948f7715bb13fedfb5ec6a155c0e Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sat, 12 Feb 2011 20:55:34 +0530 Subject: [PATCH] update hook: bypass check needs to go into BEGIN block --- hooks/common/update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hooks/common/update b/hooks/common/update index 9ed1ea8..b8a4ec0 100755 --- a/hooks/common/update +++ b/hooks/common/update @@ -11,6 +11,10 @@ use warnings; # ---------------------------------------------------------------------------- BEGIN { + # people with shell access should be allowed to bypass the update hook, + # simply by setting an env var that the ssh "front door" will never set + exit 0 if exists $ENV{GL_BYPASS_UPDATE_HOOK}; + die "ENV GL_RC not set\n" unless $ENV{GL_RC}; die "ENV GL_BINDIR not set\n" unless $ENV{GL_BINDIR}; } @@ -23,10 +27,6 @@ use gitolite qw(:DEFAULT %repos); # start... # ---------------------------------------------------------------------------- -# people with shell access should be allowed to bypass the update hook, simply -# by setting an env var that the ssh "front door" will never set -exit 0 if exists $ENV{GL_BYPASS_UPDATE_HOOK}; - my ($perm, $creator, $wild) = repo_rights($ENV{GL_REPO}); my $reported_repo = $ENV{GL_REPO} . ( $wild ? " ($wild)" : "" );