TQ\Git\Repository\Repository::findRepositoryRoot PHP Method

findRepositoryRoot() public static method

Tries to find the root directory for a given repository path
public static findRepositoryRoot ( string $path ) : string | null
$path string The file system path
return string | null NULL if the root cannot be found, the root path otherwise
    public static function findRepositoryRoot($path)
    {
        return FileSystem::bubble($path, function ($p) {
            $gitDir = $p . '/' . '.git';
            return file_exists($gitDir) && is_dir($gitDir);
        });
    }