public static function findRepositoryRoot(Binary $svn, $path)
{
$hasSvnDir = function ($path) {
$svnDir = $path . '/' . '.svn';
return file_exists($svnDir) && is_dir($svnDir);
};
$pathWithSvnDir = FileSystem::bubble($path, $hasSvnDir);
$root = $pathWithSvnDir;
$parentDir = dirname($pathWithSvnDir);
while ($hasSvnDir($parentDir) && strlen($root) > 1) {
$root = dirname($root);
$parentDir = dirname($parentDir);
}
return $root;
}