Allow search backends to return statuses instead of result sets
[lhc/web/wiklou.git] / includes / GitInfo.php
index a0a216e..6f7f802 100644 (file)
@@ -41,11 +41,11 @@ class GitInfo {
        private static $viewers = false;
 
        /**
-        * @param $dir string The root directory of the repo where the .git dir can be found
+        * @param string $dir The root directory of the repo where the .git dir can be found
         */
        public function __construct( $dir ) {
                $this->basedir = "{$dir}/.git";
-               if ( is_readable( $this->basedir ) ) {
+               if ( is_readable( $this->basedir ) && !is_dir( $this->basedir ) ) {
                        $GITfile = file_get_contents( $this->basedir );
                        if ( strlen( $GITfile ) > 8 && substr( $GITfile, 0, 8 ) === 'gitdir: ' ) {
                                $path = rtrim( substr( $GITfile, 8 ), "\r\n" );
@@ -70,7 +70,7 @@ class GitInfo {
        /**
         * Check if a string looks like a hex encoded SHA1 hash
         *
-        * @param $str string The string to check
+        * @param string $str The string to check
         * @return bool Whether or not the string looks like a SHA1
         */
        public static function isSHA1( $str ) {