X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/7c5ea8dded583601f29c7ea9bcb507ecbdd854d6..d5901a1fcc8b79f9a23bd3888ef2f281f07b9459:/scripts/index.php diff --git a/scripts/index.php b/scripts/index.php index 5afbee0..5da912e 100644 --- a/scripts/index.php +++ b/scripts/index.php @@ -28,19 +28,17 @@ if ($GLOBALS['phorkie']['cfg']['setupcheck']) { $db = new Database(); $idx = $db->getIndexer(); -//cleanup -echo "Deleting all index data\n"; -$idx->deleteAllRepos(); - //create mapping -echo "Index setup\n"; -$db->getSetup()->setup(); +echo "Index reset\n"; +$db->getSetup()->reset(); $rs = new Repositories(); list($repos, $count) = $rs->getList(0, 10000); foreach ($repos as $repo) { echo 'Indexing ' . $repo->id . "\n"; - $idx->addRepo($repo, filectime($repo->gitDir)); + $commits = $repo->getHistory(); + $first = count($commits)-1; + $idx->addRepo($repo, $commits[$first]->committerTime, $commits[0]->committerTime); } ?>