From 3fbac71f04f414fff537ed1f021ee7b1b1418a86 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Wed, 21 Jan 2009 19:56:47 +0100 Subject: [PATCH] Fixed to redirect the user to the home if no available branch. This is a short term fix. We need to create a "howto" page for each kind of repository to display it when the user want to access a repository with nothing in it. --- src/IDF/Views/Source.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index a05ef35..85f21e2 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -80,6 +80,12 @@ class IDF_Views_Source $scm = IDF_Scm::get($request->project); $commit = $match[2]; $branches = $scm->getBranches(); + if (count($branches) == 0) { + // Redirect to the project home + $url = Pluf_HTTP_URL_urlForView('IDF_Views_Project::home', + array($request->project->shortname)); + return new Pluf_HTTP_Response_Redirect($url); + } if ('commit' != $scm->testHash($commit)) { // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',