bugfix: smart http mode wasn't running pre_ and post_ git triggers

(while we're about it, we also steal Michael Brown's idea (patch #2 in
[1] and get rid of GIT_HTTP_BACKEND).

[1]: http://groups.google.com/group/gitolite/msg/adfae758dd28f2a8
redis
Sitaram Chamarty 2012-05-05 07:11:59 +05:30
parent 6d057fb84c
commit 196706c145
3 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,6 @@ Please adjust the instructions below to reflect your setup (users and paths).
Edit your .gitolite.rc and add
$ENV{GIT_HTTP_BACKEND} = "/usr/libexec/git-core/git-http-backend";
$ENV{PATH} .= ":/opt/git/bin";
at the very top (as described in `t/smart-http.root-setup`).

View File

@ -121,11 +121,13 @@ sub main {
gl_log( "pre_git", $repo, $user, $aa, 'any', "-> $ret" );
}
exec $ENV{GIT_HTTP_BACKEND} if $ENV{REQUEST_URI};
trigger( 'PRE_GIT', $repo, $user, $aa, 'any', $verb );
my $repodir = "'$rc{GL_REPO_BASE}/$repo.git'";
_system( "git", "shell", "-c", "$verb $repodir" );
if ($ENV{REQUEST_URI}) {
_system( "git", "http-backend" );
} else {
my $repodir = "'$rc{GL_REPO_BASE}/$repo.git'";
_system( "git", "shell", "-c", "$verb $repodir" );
}
trigger( 'POST_GIT', $repo, $user, $aa, 'any', $verb );
}

View File

@ -46,7 +46,6 @@ cd $GITOLITE_HTTP_HOME
HOME=$GITOLITE_HTTP_HOME gitolite setup -a admin
# insert some essential lines at the beginning of the rc file
echo '$ENV{GIT_HTTP_BACKEND} = "/usr/libexec/git-core/git-http-backend";' > 1
echo '$ENV{PATH} .= ":$ENV{GITOLITE_HTTP_HOME}/bin";' >> 1
echo >> 1
cat .gitolite.rc >> 1