$breadcrumbs = $app['utils']->getBreadcrumbs("$repo/tree/$branch/$tree");
if (($slash = strrpos($tree, '/')) !== false) {
$parent = '/' . substr($tree, 0, $slash);
} else {
$parent = '/';
}
return $app['twig']->render('tree.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'files',
'files' => $files->output(),
'repo' => $repo,
'branch' => $branch,
'path' => "$tree/",
'parent' => $parent,
'breadcrumbs' => $breadcrumbs,
'branches' => $repository->getBranches(),
'tags' => $repository->getTags(),
));
})->assert('tree', '.+')
->assert('repo', '[\w-._]+')