From 196706c1457d9ad242bd2a9ef833f21f1dd6b607 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sat, 5 May 2012 07:11:59 +0530 Subject: [PATCH] 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 --- doc/http.mkd | 1 - src/gitolite-shell | 10 ++++++---- t/smart-http.root-setup | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/http.mkd b/doc/http.mkd index bfc7544..3b9809e 100644 --- a/doc/http.mkd +++ b/doc/http.mkd @@ -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`). diff --git a/src/gitolite-shell b/src/gitolite-shell index 07e2cd5..af03a36 100755 --- a/src/gitolite-shell +++ b/src/gitolite-shell @@ -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 ); } diff --git a/t/smart-http.root-setup b/t/smart-http.root-setup index ed3d413..dd42ad9 100755 --- a/t/smart-http.root-setup +++ b/t/smart-http.root-setup @@ -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