- $new = $this->fork($url);
- file_put_contents(
- $new->gitDir . '/description',
- 'Fork of ' . $url
- );
+ $new = $this->fork($cloneUrl);
+
+ $new->getVc()
+ ->getCommand('config')
+ ->addArgument('remote.origin.title')
+ ->addArgument($title)
+ ->execute();
+ if ($originalUrl != $cloneUrl) {
+ $new->getVc()
+ ->getCommand('config')
+ ->addArgument('remote.origin.homepage')
+ ->addArgument($originalUrl)
+ ->execute();
+ }
+
+ if ($title === null) {
+ $title = 'Fork of ' . $originalUrl;
+ }
+ file_put_contents($new->gitDir . '/description', $title);
+
+ $this->index($new);
+
+ $not = new Notificator();
+ $not->create($new);
+