Throw exception if git repository not found
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Jan 2011 23:31:50 +0000 (16:31 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 21 Jan 2011 18:40:56 +0000 (11:40 -0700)
framework/Vcs/lib/Horde/Vcs/Git.php

index 543e9df..178c3a2 100644 (file)
@@ -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
+}