diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-04-11 20:22:33 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-04-11 20:22:33 +0200 |
| commit | 1c14a6bfb93c914374a6b2f96aec971f8c5b3053 (patch) | |
| tree | fbc8ed02a6ad900b96dfe5259edba0bcdd0a9a66 /src/phorkie/Repository/Post.php | |
| parent | bf139cf4f0d6fb868d0f998d3213f7e681fbff92 (diff) | |
| download | phorkie-1c14a6bfb93c914374a6b2f96aec971f8c5b3053.tar.gz phorkie-1c14a6bfb93c914374a6b2f96aec971f8c5b3053.zip | |
separate git and work directories - gives nicer public git clone urls
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; |
