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 43f2b23..ed07fb5 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];