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