protected function getFiles($repository, $tree, $branch, $path)
{
//Cache
if (!$path) {
$key = md5($repository->getPath() . $tree . $branch);
return Cache::remember('files_' . $key, 10, function () use($repository, $tree, $branch, $path) {
$files = $repository->getTree($tree ? "{$branch}:\"{$tree}\"/" : $branch);
return $files->output($path);
});
}
$files = $repository->getTree($tree ? "{$branch}:\"{$tree}\"/" : $branch);
return $files->output($path);
}