6 public function forkLocal($repo)
8 $new = $this->fork($repo->gitDir);
9 \copy($repo->gitDir . '/description', $new->gitDir . '/description');
14 public function forkRemote($cloneUrl, $originalUrl)
16 $new = $this->fork($cloneUrl);
18 $new->gitDir . '/description',
19 'Fork of ' . $originalUrl
26 protected function fork($pathOrUrl)
28 $rs = new Repositories();
29 $new = $rs->createNew();
31 \rmdir($new->gitDir);//VersionControl_Git wants an existing dir, git clone not
32 $vc->getCommand('clone')
33 //this should be setOption, but it fails with a = between name and value
34 ->addArgument('--separate-git-dir')
35 ->addArgument($GLOBALS['phorkie']['cfg']['gitdir'] . '/' . $new->id . '.git')
36 ->addArgument($pathOrUrl)
37 ->addArgument($new->workDir)
39 foreach (\glob($new->gitDir . '/hooks/*') as $hookfile) {
46 protected function index($repo)
49 $db->getIndexer()->addRepo($repo);