'repo' => $repo,
'branch' => $branch,
'branches' => $repository->getBranches(),
'tags' => $repository->getTags(),
'commits' => $categorized,
));
})->assert('repo', '[\w-._]+')
->assert('file', '.+')
->assert('branch', '[\w-._]+');
$app->get('{repo}/commit/{commit}/', function($repo, $commit) use($app) {
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
$commit = $repository->getCommit($commit);
return $app['twig']->render('commit.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'commits',
'branch' => 'master',
'repo' => $repo,
'commit' => $commit,
));
})->assert('repo', '[\w-._]+')
->assert('commit', '[a-f0-9]+');
$app->get('{repo}/blame/{branch}/{file}/', function($repo, $branch, $file) use($app) {
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
$blames = $repository->getBlame($file);
return $app['twig']->render('blame.twig', array(
'baseurl' => $app['baseurl'],
'page' => 'commits',
'file' => $file,
'repo' => $repo,
'branch' => $branch,
'branches' => $repository->getBranches(),
'tags' => $repository->getTags(),
'blames' => $blames,
));
})->assert('repo', '[\w-._]+')
->assert('file', '.+')
->assert('branch', '[\w-._]+');