6 public function forkLocal($repo)
8 $new = $this->fork($repo->gitDir);
9 \copy($repo->gitDir . '/description', $new->gitDir . '/description');
12 $not = new Notificator();
18 public function forkRemote($cloneUrl, $originalUrl)
20 $new = $this->fork($cloneUrl);
22 $new->gitDir . '/description',
23 'Fork of ' . $originalUrl
27 $not = new Notificator();
34 protected function fork($pathOrUrl)
36 $rs = new Repositories();
37 $new = $rs->createNew();
40 //VersionControl_Git wants an existing dir, git clone not
43 $cmd = $vc->getCommand('clone')
44 //this should be setOption, but it fails with a = between name and value
45 ->addArgument('--separate-git-dir')
47 $GLOBALS['phorkie']['cfg']['gitdir'] . '/' . $new->id . '.git'
49 ->addArgument($pathOrUrl)
50 ->addArgument($new->workDir);
53 } catch (\Exception $e) {
54 //clean up, we've got no workdir otherwise
59 $rs = new Repository_Setup($new);
65 protected function index($repo)
68 $db->getIndexer()->addRepo($repo);