From 4bf1f2ca1b688395eac6e2517fdbce4e87cce0d5 Mon Sep 17 00:00:00 2001 From: paulr Date: Mon, 7 Nov 2011 04:36:06 +1100 Subject: [PATCH] got a working git backend with web push. however, it'll need some explaining when a user creates a repo for the first time --- gwvplib/gwvpgitcontrol.php | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/gwvplib/gwvpgitcontrol.php b/gwvplib/gwvpgitcontrol.php index 4622f27..dddf0b2 100644 --- a/gwvplib/gwvpgitcontrol.php +++ b/gwvplib/gwvpgitcontrol.php @@ -102,6 +102,9 @@ function gwvp_gitBackendInterface() // now we need to rebuild the actual request or do we? //$basegit = "$BASE_URL/git/something.git"; //$newloc = preg_replace("/^$basegit/", "", $_SERVER["REQUEST_URI"]); + chdir("$repo_base/$repo"); + exec("/usr/bin/git update-server-info"); + if($_SERVER["REQUEST_METHOD"] == "POST") { gwvp_AskForBasicAuth(); gwvp_callGitBackend($repo); @@ -190,6 +193,8 @@ function gwvp_callGitBackend($repo) error_log("path trans'd is /tmp/$repo/$euri from $ruri with ".$_REQUEST["q"]." $strrem"); + + $pwd = "/tmp/"; @@ -249,9 +254,14 @@ function gwvp_callGitBackend($repo) // i.e. why the pointer doesnt increment over it, cause the freads above then get them again. if($firstline) { if(strlen($from_cgi_data_t)>0) { + // i dont get why this happens, and its very frustrating.. im not sure if its a bug in php + // or something the git-http-backend thing is doing.. + // TODO: find out why this happens $from_cgi_data = preg_replace("/^\r\n/", "", $from_cgi_data_t); if(strlen($from_cgi_data)!=strlen($from_cgi_data_t)) { error_log("MOOOKS - we did trunc"); + } else { + error_log("MOOOKS - we did not trunc"); } $firstline = false; } -- 1.7.0.4