use addRepo for indexing new repositories
authorChristian Weiske <cweiske@cweiske.de>
Mon, 7 May 2012 21:10:14 +0000 (23:10 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 7 May 2012 21:10:14 +0000 (23:10 +0200)
src/phorkie/Repository/Post.php

index 633fb27..438bf5a 100644 (file)
@@ -122,7 +122,11 @@ class Repository_Post
             //FIXME: index changed files only
             //also handle file deletions
             $db = new Database();
-            $db->getIndexer()->updateRepo($this->repo);
+            if ($bNew) {
+                $db->getIndexer()->addRepo($this->repo);
+            } else {
+                $db->getIndexer()->updateRepo($this->repo);
+            }
         }
 
         return true;