From 4ac5bc4f640978b98f27ecc14c7f235cf7b32d6d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 20 Jan 2011 16:31:50 -0700 Subject: [PATCH] Throw exception if git repository not found --- framework/Vcs/lib/Horde/Vcs/Git.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/Vcs/lib/Horde/Vcs/Git.php b/framework/Vcs/lib/Horde/Vcs/Git.php index 543e9df67..178c3a208 100644 --- a/framework/Vcs/lib/Horde/Vcs/Git.php +++ b/framework/Vcs/lib/Horde/Vcs/Git.php @@ -63,6 +63,9 @@ class Horde_Vcs_Git extends Horde_Vcs */ public $version; + /** + * @throws Horde_Vcs_Exception + */ public function __construct($params = array()) { parent::__construct($params); @@ -81,6 +84,8 @@ class Horde_Vcs_Git extends Horde_Vcs $this->_sourceroot .= '.git'; } elseif (file_exists($this->sourceroot() . '/.git/HEAD')) { $this->_sourceroot .= '/.git'; + } else { + throw new Horde_Vcs_Exception('Can not find git repository.'); } } } @@ -315,4 +320,4 @@ class Horde_Vcs_Git extends Horde_Vcs { return 'master'; } -} \ No newline at end of file +} -- 2.11.0