parse logs with commits that have no line changes
authorChristian Weiske <cweiske@cweiske.de>
Wed, 19 Sep 2012 22:20:12 +0000 (00:20 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 19 Sep 2012 22:20:12 +0000 (00:20 +0200)
src/phorkie/Repository.php

index 43f2b23dddf0be98f7ac56626cd1cc506be35541..ed07fb50a771eb0db00e6d96a8829108601d3042 100644 (file)
@@ -310,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];