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

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

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

        return true;
    }