X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=gwvplib%2Fgwvpgitcontrol.php;h=68935a2ee755f75484af610fa920d0d1b4412d96;hb=74399e0d5226d43656c618451b4e6fc06702e5ab;hp=2755859565774bd8727fe12c9fc2325032a780a1;hpb=e3bdcdac5fc5d9cec5db491543a9ab1c090706cd;p=gwvp.git diff --git a/gwvplib/gwvpgitcontrol.php b/gwvplib/gwvpgitcontrol.php index 2755859..68935a2 100644 --- a/gwvplib/gwvpgitcontrol.php +++ b/gwvplib/gwvpgitcontrol.php @@ -22,7 +22,7 @@ function gwvp_gitControlCallMe() } -function gwvp_repoPermissionCheck() +function gwvp_repoPermissionCheck($repo, $user) { return true; } @@ -127,11 +127,22 @@ function gwvp_repoExists($name) else return false; } -function gwvp_createGitRepo($name) +function gwvp_createGitRepo($name, $bundle=null) { global $repo_base; - error_log("would create $repo_base/$name.git"); + // phew, this works, but i tell you this - bundles arent quite as nice as they should be + if($bundle == null) { + error_log("would create $repo_base/$name.git"); + exec("/usr/bin/git init $repo_base/$name.git --bare > /tmp/gitlog 2>&1"); + chdir("$repo_base/$name.git"); + exec("/usr/bin/git update-server-info"); + } else { + error_log("create via mirror on $repo_base/$name.git"); + exec("/usr/bin/git clone --mirror $bundle $repo_base/$name.git > /tmp/gitlog 2>&1"); + chdir("$repo_base/$name.git"); + exec("/usr/bin/git update-server-info"); + } return true; }