From: Michael M Slusarz Date: Thu, 20 Jan 2011 23:31:50 +0000 (-0700) Subject: Throw exception if git repository not found X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4ac5bc4f640978b98f27ecc14c7f235cf7b32d6d;p=horde.git Throw exception if git repository not found --- 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 +}