From 2eb87f345dbac3b64e8e8cc7cc7e70ca9ca73b68 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Thu, 12 Mar 2009 13:54:52 -0400 Subject: [PATCH] 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) --- framework/Vcs/lib/Horde/Vcs/Git.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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'); } -- 2.11.0