mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Code for loading repo in TreeController.
This commit is contained in:
@@ -75,20 +75,16 @@ echo "searc\n";
|
|||||||
->assert('branch', '[\w-._\/]+')
|
->assert('branch', '[\w-._\/]+')
|
||||||
->bind('search');
|
->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) {
|
$route->get('{repo}/{format}ball/{branch}', function($repo, $format, $branch) use ($app) {
|
||||||
$repository = $app['git']->getRepositoryCached($app['git.repos'], $repo);
|
echo "tarball\n";
|
||||||
$path = $repository->getPath();
|
|
||||||
|
$repo_item = $app['git']->getRepositoryCached($app['git.repos'], $repo);
|
||||||
|
$path = $repo_item->getPath();
|
||||||
|
|
||||||
|
$repository = $app['git']->getRepository($path );
|
||||||
|
|
||||||
$tree = $repository->getBranchTree($branch);
|
$tree = $repository->getBranchTree($branch);
|
||||||
|
|
||||||
@@ -120,6 +116,19 @@ echo "searc\n";
|
|||||||
->assert('branch', '[\w-._\/]+')
|
->assert('branch', '[\w-._\/]+')
|
||||||
->bind('archive');
|
->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;
|
return $route;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user