From 8092f9c3c8fc29dc34fc9b1b91abb9cb69eeb1bb Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Thu, 7 Jun 2012 02:37:45 -0300 Subject: [PATCH] Better error handling in the commit log --- lib/Git/Repository.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Git/Repository.php b/lib/Git/Repository.php index de453c4..2b930f4 100644 --- a/lib/Git/Repository.php +++ b/lib/Git/Repository.php @@ -333,6 +333,10 @@ class Repository $commit->importData($data); unset($logs[0]); + if (empty($logs[1])) { + throw new \RuntimeException('No commit log available'); + } + // Read diff logs foreach ($logs as $log) { if ('diff' === substr($log, 0, 4)) {