X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/5d76ec85a500321127ac879ffaa0aabd686bb7bf..3543bfd4d6c2ff90417d775b4eac74e1f2bd8d10:/src/phorkie/Repository.php diff --git a/src/phorkie/Repository.php b/src/phorkie/Repository.php index c854cf1..448982b 100644 --- a/src/phorkie/Repository.php +++ b/src/phorkie/Repository.php @@ -176,10 +176,23 @@ class Repository */ public function delete() { + $db = new Database(); + $db->getIndexer()->deleteRepo($this); + return Tools::recursiveDelete($this->workDir) && Tools::recursiveDelete($this->gitDir); } + public function getTitle() + { + $desc = $this->getDescription(); + if (trim($desc) != '') { + return $desc; + } + + return 'paste #' . $this->id; + } + public function getDescription() { if (!is_readable($this->gitDir . '/description')) { @@ -269,7 +282,9 @@ class Repository $arLineParts = explode(' ', trim($arOutput[$current + 4])); $commit->filesChanged = $arLineParts[0]; $commit->linesAdded = $arLineParts[3]; - $commit->linesDeleted = $arLineParts[5]; + if (isset($arLineParts[5])) { + $commit->linesDeleted = $arLineParts[5]; + } $current += 6;