catch the case when there is no ls-tree output for the current path (looks like this...
authorChuck Hagenbuch <chuck@horde.org>
Thu, 12 Mar 2009 17:54:52 +0000 (13:54 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 12 Mar 2009 17:54:52 +0000 (13:54 -0400)
framework/Vcs/lib/Horde/Vcs/Git.php

index 7338c72..491e72a 100644 (file)
@@ -69,8 +69,10 @@ class Horde_Vcs_Git extends Horde_Vcs
     {
         $where = str_replace($this->sourceroot() . '/', '', $where);
         $command = $this->getCommand() . ' ls-tree master ' . escapeshellarg($where) . ' 2>&1';
-        $entry = array();
-        exec($command, $entry);
+        exec($command, $entry, $retval);
+
+        if (!count($entry)) { return false; }
+
         $data = explode(' ', $entry[0]);
         return ($data[1] == 'blob');
     }