GL_BYPASS_UPDATE_HOOK -> GL_BYPASS_ACCESS_CHECKS, also added to gitolite-shell
This commit is contained in:
parent
c2991d974d
commit
a439f47a67
|
@ -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};
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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'";
|
||||
|
|
Loading…
Reference in a new issue