mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 11:10:57 +01:00
Code for loading repo in TreeController.
This commit is contained in:
@@ -75,20 +75,16 @@ echo "searc\n";
|
||||
->assert('branch', '[\w-._\/]+')
|
||||
->bind('search');
|
||||
|
||||
$route->get('{repo}/{branch}/', function($repo, $branch) use ($app, $treeController) {
|
||||
return $treeController($repo, $branch);
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('branch', '[\w-._\/]+')
|
||||
->bind('branch');
|
||||
|
||||
$route->get('{repo}/', function($repo) use ($app, $treeController) {
|
||||
return $treeController($repo);
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->bind('repository');
|
||||
|
||||
# WRI: Changed order of this and next statement, because order
|
||||
# appears to be important, and the other statement got precedence
|
||||
$route->get('{repo}/{format}ball/{branch}', function($repo, $format, $branch) use ($app) {
|
||||
$repository = $app['git']->getRepositoryCached($app['git.repos'], $repo);
|
||||
$path = $repository->getPath();
|
||||
echo "tarball\n";
|
||||
|
||||
$repo_item = $app['git']->getRepositoryCached($app['git.repos'], $repo);
|
||||
$path = $repo_item->getPath();
|
||||
|
||||
$repository = $app['git']->getRepository($path );
|
||||
|
||||
$tree = $repository->getBranchTree($branch);
|
||||
|
||||
@@ -120,6 +116,19 @@ echo "searc\n";
|
||||
->assert('branch', '[\w-._\/]+')
|
||||
->bind('archive');
|
||||
|
||||
|
||||
$route->get('{repo}/{branch}/', function($repo, $branch) use ($app, $treeController) {
|
||||
return $treeController($repo, $branch);
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('branch', '[\w-._\/]+')
|
||||
->bind('branch');
|
||||
|
||||
$route->get('{repo}/', function($repo) use ($app, $treeController) {
|
||||
return $treeController($repo);
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->bind('repository');
|
||||
|
||||
|
||||
return $route;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user