public function search($owner, $project, $branch = '', $tree = '')
{
$repository = $project->getRepository();
if (!$branch) {
$branch = $repository->getHead();
}
$query = Input::get('query');
$results = $repository->searchTree($query, $branch);
return View::make('projects/search')->withResults($results)->withOwner($owner)->withProject($project)->withBranch($branch)->withPath($tree)->withBranches($repository->getBranches())->withTags($repository->getTags())->withQuery($query);
}