public function isGitDir($requireRoot = true)
    {
        $directory = $this->getGitDir();

        if ('' === $directory) {
            return false;
        }

        if ($requireRoot && str_replace('\\', '/', getcwd()) !== $directory) {
            return false;
        }

        return true;
    }
public function isGitDir($requireRoot = true)
    {
        $directory = $this->getGitDir();

        if ('' === $directory) {
            return false;
        }

        if ($requireRoot && str_replace('\\', '/', getcwd()) !== $directory) {
            return false;
        }

        return true;
    }
public function isGitDir ( $ requireRoot = true ) { $ directory = $ this -> getGitDir ( ) ; if ( '' === $ directory ) { return false ; } if ( $ requireRoot && str_replace ( '\\' , '/' , getcwd ( ) ) !== $ directory ) { return false ; } return true ; }
Returns whether the current working dir is a Git directory.

@param bool $requireRoot Require directory is the root of the Git repository,
default is true.

@return bool
Returns whether the current working dir is a Git directory .