mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
Issue #61: Read default branch from .git/HEAD
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
$app->get('{repo}/', function($repo) use($app) {
|
||||
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
|
||||
$tree = $repository->getTree('master');
|
||||
$defaultBranch = $repository->getHead();
|
||||
$tree = $repository->getTree($defaultBranch);
|
||||
$breadcrumbs = $app['utils']->getBreadcrumbs("$repo/");
|
||||
|
||||
return $app['twig']->render('tree.twig', array(
|
||||
@@ -10,7 +11,7 @@ $app->get('{repo}/', function($repo) use($app) {
|
||||
'page' => 'files',
|
||||
'files' => $tree->output(),
|
||||
'repo' => $repo,
|
||||
'branch' => 'master',
|
||||
'branch' => $defaultBranch,
|
||||
'path' => '',
|
||||
'parent' => '',
|
||||
'breadcrumbs' => $breadcrumbs,
|
||||
@@ -66,4 +67,4 @@ $app->get('{repo}/tree/{branch}/{tree}/', function($repo, $branch, $tree) use($a
|
||||
));
|
||||
})->assert('tree', '.+')
|
||||
->assert('repo', '[\w-._]+')
|
||||
->assert('branch', '[\w-._]+');
|
||||
->assert('branch', '[\w-._]+');
|
||||
|
||||
Reference in New Issue
Block a user