From a439f47a6723a1d13abc2bcd262b0fa62b4728a9 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Wed, 28 Mar 2012 15:25:32 +0530 Subject: [PATCH] GL_BYPASS_UPDATE_HOOK -> GL_BYPASS_ACCESS_CHECKS, also added to gitolite-shell --- src/Gitolite/Hooks/Update.pm | 2 +- src/VREF/partial-copy | 2 +- src/gitolite-shell | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Gitolite/Hooks/Update.pm b/src/Gitolite/Hooks/Update.pm index 9d4b44e..d772c2a 100644 --- a/src/Gitolite/Hooks/Update.pm +++ b/src/Gitolite/Hooks/Update.pm @@ -144,7 +144,7 @@ use strict; use warnings; BEGIN { - exit 0 if $ENV{GL_BYPASS_UPDATE_HOOK}; + exit 0 if $ENV{GL_BYPASS_ACCESS_CHECKS}; die "GL_BINDIR not set; aborting\n" unless $ENV{GL_BINDIR}; } use lib $ENV{GL_BINDIR}; diff --git a/src/VREF/partial-copy b/src/VREF/partial-copy index 4cb4440..efb73bf 100755 --- a/src/VREF/partial-copy +++ b/src/VREF/partial-copy @@ -21,7 +21,7 @@ main=`git config --file $GL_REPO_BASE/$repo.git/config --get gitolite.partialCop [ -z "$main" ] && exit 0 rand=$RANDOM -export GL_BYPASS_UPDATE_HOOK=1 +export GL_BYPASS_ACCESS_CHECKS=1 git push -f $GL_REPO_BASE/$main.git $new:refs/heads/br-$rand || die "FATAL: failed to send $new" diff --git a/src/gitolite-shell b/src/gitolite-shell index 1706c48..c3381da 100755 --- a/src/gitolite-shell +++ b/src/gitolite-shell @@ -88,11 +88,13 @@ sub main { # yet know the ref that will be eventually pushed (and even that won't # apply if it's a read operation). See the matching code in access() for # more information. - my $ret = access( $repo, $user, $aa, 'any' ); - trace( 1, "access($repo, $user, $aa, 'any')", "-> $ret" ); - gl_log( 'check1', $repo, $user, $aa, 'any', '->', $ret ); - trigger( 'ACCESS_1', $repo, $user, $aa, 'any', $ret ); - _die $ret . "\n(or you mis-spelled the reponame)" if $ret =~ /DENIED/; + unless ($ENV{GL_BYPASS_ACCESS_CHECKS}) { + my $ret = access( $repo, $user, $aa, 'any' ); + trace( 1, "access($repo, $user, $aa, 'any')", "-> $ret" ); + gl_log( 'check1', $repo, $user, $aa, 'any', '->', $ret ); + trigger( 'ACCESS_1', $repo, $user, $aa, 'any', $ret ); + _die $ret . "\n(or you mis-spelled the reponame)" if $ret =~ /DENIED/; + } trigger( 'PRE_GIT', $repo, $user, $aa, 'any', $verb ); my $repodir = "'$rc{GL_REPO_BASE}/$repo.git'";