X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/bf139cf4f0d6fb868d0f998d3213f7e681fbff92..1c14a6bfb93c914374a6b2f96aec971f8c5b3053:/src/phorkie/Repository/Post.php diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index 8cd9323..6ff8df6 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -114,13 +114,19 @@ class Repository_Post $rs = new Repositories(); $repo = $rs->createNew(); $vc = $repo->getVc(); - $vc->initRepository(); - - foreach (glob($repo->repoDir . '/.git/hooks/*') as $hookfile) { + //$vc->initRepository(); + $vc->getCommand('init') + //this should be setOption, but it fails with a = between name and value + ->addArgument('--separate-git-dir') + ->addArgument($GLOBALS['phorkie']['cfg']['gitdir'] . '/' . $repo->id) + ->addArgument($repo->workDir) + ->execute(); + + foreach (glob($repo->gitDir . '/hooks/*') as $hookfile) { unlink($hookfile); } - touch($repo->repoDir . '/.git/git-daemon-export-ok'); + touch($repo->gitDir . '/git-daemon-export-ok'); return $repo; } @@ -130,7 +136,7 @@ class Repository_Post $num = -1; do { ++$num; - $files = glob($this->repo->repoDir . '/' . $prefix . $num . '.*'); + $files = glob($this->repo->workDir . '/' . $prefix . $num . '.*'); } while (count($files)); return $prefix . $num;