+ //FIXME: git needs ref BEFORE add
+ //quick hack until http://pear.php.net/bugs/bug.php?id=19605 is fixed
+ $vc->getCommand('notes --ref=identity add')
+ ->setOption('force')
+ ->setOption('message', "$notes")
+ ->setEnvVar('GIT_AUTHOR_NAME', $sessionData['name'])
+ ->setEnvVar('GIT_AUTHOR_EMAIL', $sessionData['email'])
+ ->setEnvVar('GIT_COMMITTER_NAME', $sessionData['name'])
+ ->setEnvVar('GIT_COMMITTER_EMAIL', $sessionData['email'])
+ ->execute();
+ //update info for dumb git HTTP transport
+ //the post-update hook should do that IMO, but does not somehow
+ $vc->getCommand('update-server-info')->execute();
+
+ //we changed the hash by committing, so reload it
+ $this->repo->reloadHash();
+
+ $bChanged = true;
+ }
+
+ if ($bChanged) {
+ //FIXME: index changed files only
+ //also handle file deletions
+ $db = new Database();
+ $not = new Notificator();
+ if ($bNew) {
+ $db->getIndexer()->addRepo($this->repo);
+ $not->create($this->repo);
+ } else {
+ $commits = $this->repo->getHistory();
+ $db->getIndexer()->updateRepo(
+ $this->repo,
+ $commits[count($commits)-1]->committerTime,
+ $commits[0]->committerTime
+ );
+ $not->edit($this->repo);
+ }