Fixed to prevent the display of an invalid tree.

master
Loic d'Anterroches 2009-08-20 15:14:42 +02:00
parent c3ae1970ca
commit 14e074b122
1 changed files with 7 additions and 0 deletions

View File

@ -210,6 +210,13 @@ class IDF_Views_Source
$page_title = $bc.' - '.$title; $page_title = $bc.' - '.$title;
$cobject = $scm->getCommit($commit); $cobject = $scm->getCommit($commit);
if (!$cobject) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$scm->getMainBranch()));
return new Pluf_HTTP_Response_Redirect($url);
}
$in_branches = $scm->inBranches($commit, $request_file); $in_branches = $scm->inBranches($commit, $request_file);
$cache = Pluf_Cache::factory(); $cache = Pluf_Cache::factory();
$key = sprintf('Project:%s::IDF_Views_Source::tree:%s::%s', $key = sprintf('Project:%s::IDF_Views_Source::tree:%s::%s',