parse logs with commits that have no line changes
[phorkie.git] / src / phorkie / Repository.php
index 9f8f264c413cb14fba579a4b072c7a9383d403a5..ed07fb50a771eb0db00e6d96a8829108601d3042 100644 (file)
@@ -104,6 +104,11 @@ class Repository
         $this->hash = $output;
     }
 
+       /**
+     * Populates $this->message
+     *
+     * @return void
+     */
     public function loadMessage()
     {
         $rev = (isset($this->hash)) ? $this->hash : 'HEAD';
@@ -252,6 +257,8 @@ class Repository
             return '/' . $this->id;
         } else if ($type == 'fork') {
             return '/' . $this->id . '/fork';
+        } else if ($type == 'doap') {
+            return '/' . $this->id . '/doap';
         } else if ($type == 'delete') {
             return '/' . $this->id . '/delete';
         } else if ($type == 'delete-confirm') {
@@ -303,6 +310,13 @@ class Repository
             $commit->committerName  = $arOutput[$current + 2];
             $commit->committerEmail = $arOutput[$current + 3];
 
+            if (substr($arOutput[$current + 4], 0, 1) != ' ') {
+                //commit without changed lines
+                $arCommits[] = $commit;
+                $current += 4;
+                continue;
+            }
+
             $arLineParts = explode(' ', trim($arOutput[$current + 4]));
             $commit->filesChanged = $arLineParts[0];
             $commit->linesAdded   = $arLineParts[3];