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
This commit is contained in:
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 Edit your .gitolite.rc and add
$ENV{GIT_HTTP_BACKEND} = "/usr/libexec/git-core/git-http-backend";
$ENV{PATH} .= ":/opt/git/bin"; $ENV{PATH} .= ":/opt/git/bin";
at the very top (as described in `t/smart-http.root-setup`). 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" ); 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 ); trigger( 'PRE_GIT', $repo, $user, $aa, 'any', $verb );
my $repodir = "'$rc{GL_REPO_BASE}/$repo.git'"; if ($ENV{REQUEST_URI}) {
_system( "git", "shell", "-c", "$verb $repodir" ); _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 ); 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 HOME=$GITOLITE_HTTP_HOME gitolite setup -a admin
# insert some essential lines at the beginning of the rc file # 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 '$ENV{PATH} .= ":$ENV{GITOLITE_HTTP_HOME}/bin";' >> 1
echo >> 1 echo >> 1
cat .gitolite.rc >> 1 cat .gitolite.rc >> 1