From 2f0156e63b2fe0a16bd765b9d867cd22e2bb499e Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Tue, 9 Jun 2009 08:42:59 +0200 Subject: [PATCH] Fixed to correctly get the main branch in case of error. --- src/IDF/Views/Source.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index fc78301..5d6978b 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -77,7 +77,7 @@ class IDF_Views_Source // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog', array($request->project->shortname, - $branches[0])); + $scm->getMainBranch())); return new Pluf_HTTP_Response_Redirect($url); } $changes = $scm->getChangeLog($commit, 25); @@ -263,7 +263,7 @@ class IDF_Views_Source // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($request->project->shortname, - $branches[0])); + $scm->getMainBranch())); return new Pluf_HTTP_Response_Redirect($url); } $title = sprintf(__('%s Commit Details'), (string) $request->project); @@ -301,7 +301,7 @@ class IDF_Views_Source // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($request->project->shortname, - $branches[0])); + $scm->getMainBranch())); return new Pluf_HTTP_Response_Redirect($url); } $cobject = $scm->getCommit($commit, true); @@ -366,7 +366,7 @@ class IDF_Views_Source // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($request->project->shortname, - $branches[0])); + $scm->getMainBranch())); return new Pluf_HTTP_Response_Redirect($url); } $request_file_info = $scm->getPathInfo($request_file, $commit); @@ -374,7 +374,7 @@ class IDF_Views_Source // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($request->project->shortname, - $branches[0])); + $scm->getMainBranch())); return new Pluf_HTTP_Response_Redirect($url); } $info = self::getRequestedFileMimeType($request_file_info, @@ -399,7 +399,7 @@ class IDF_Views_Source // Redirect to the first branch $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($request->project->shortname, - $branches[0])); + $scm->getMainBranch())); return new Pluf_HTTP_Response_Redirect($url); } $base = $request->project->shortname.'-'.$commit;