tweaks I needed for logs and patchset lists to still work and not throw warnings...
authorChuck Hagenbuch <chuck@horde.org>
Wed, 17 Jun 2009 16:00:55 +0000 (12:00 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 17 Jun 2009 16:00:55 +0000 (12:00 -0400)
framework/Vcs/lib/Horde/Vcs.php
framework/Vcs/lib/Horde/Vcs/Git.php

index ab50b38..7a1feec 100644 (file)
@@ -1061,7 +1061,7 @@ abstract class Horde_Vcs_Log
 {
     protected $_rep;
     protected $_file;
-    protected $_files;
+    protected $_files = array();
     protected $_rev;
     protected $_author;
     protected $_tags = array();
@@ -1173,7 +1173,7 @@ abstract class Horde_Vcs_Log
     {
         return is_null($file)
             ? $this->_files
-            : (isset($this->_files[$file]) ? $this->_files[$file] : null);
+            : (isset($this->_files[$file]) ? $this->_files[$file] : array());
     }
 
 }
index ca3de1f..7722607 100644 (file)
@@ -653,16 +653,10 @@ class Horde_Vcs_Log_Git extends Horde_Vcs_Log
             throw new Horde_Vcs_Exception('Unable to run ' . $cmd . ': ' . error_get_last());
         }
 
-        $line = trim(fgets($pipe));
+        //$line = trim(fgets($pipe));
         while (true) {
-            $line = fgets($pipe);
-            if ($line === false) {
-                throw new Horde_Vcs_Exception('Unexpected end of log output');
-            }
-
-            $line = trim($line);
-            if ($line == '') { break; }
-
+            $line = trim(fgets($pipe));
+            if (!strlen($line)) { break; }
             if (strpos($line, ':') === false) {
                 throw new Horde_Vcs_Exception('Malformed log line: ' . $line);
             }
@@ -710,7 +704,7 @@ class Horde_Vcs_Log_Git extends Horde_Vcs_Log
 
         $log = '';
         $line = fgets($pipe);
-        while (substr($line, 0, 1) != ':') {
+        while ($line !== false && substr($line, 0, 1) != ':') {
             $log .= $line;
             $line = fgets($pipe);
         }