FIX: Index forks
[phorkie.git] / src / phorkie / Forker.php
index 3425a72283eefaa2f758301be6863bc8e155a178..affa12ae47df853809968ce73f7d502158d3bb0d 100644 (file)
@@ -10,12 +10,12 @@ class Forker
         return $new;
     }
 
-    public function forkRemote($url)
+    public function forkRemote($cloneUrl, $originalUrl)
     {
-        $new = $this->fork($url);
+        $new = $this->fork($cloneUrl);
         file_put_contents(
             $new->gitDir . '/description',
-            'Fork of ' . $url
+            'Fork of ' . $originalUrl
         );
         return $new;
     }
@@ -37,6 +37,10 @@ class Forker
         foreach (\glob($new->gitDir . '/hooks/*') as $hookfile) {
             \unlink($hookfile);
         }
+
+        $db = new Database();
+        $db->getIndexer()->addRepo($new);
+
         return $new;
     }
 }