From: Chuck Hagenbuch Date: Thu, 12 Mar 2009 17:54:52 +0000 (-0400) Subject: catch the case when there is no ls-tree output for the current path (looks like this... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2eb87f345dbac3b64e8e8cc7cc7e70ca9ca73b68;p=horde.git catch the case when there is no ls-tree output for the current path (looks like this command needs to know about the current branch, too) --- diff --git a/framework/Vcs/lib/Horde/Vcs/Git.php b/framework/Vcs/lib/Horde/Vcs/Git.php index 7338c727c..491e72a1c 100644 --- a/framework/Vcs/lib/Horde/Vcs/Git.php +++ b/framework/Vcs/lib/Horde/Vcs/Git.php @@ -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'); }