diff options
Diffstat (limited to 'src/phorkie/Repository/Post.php')
| -rw-r--r-- | src/phorkie/Repository/Post.php | 16 |
1 files changed, 11 insertions, 5 deletions
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; |
