From: Chuck Hagenbuch Date: Sat, 13 Jun 2009 01:54:52 +0000 (-0400) Subject: add a crude way of returning the default branch and make sure it is selected even... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a8e4d9cb3a8977ee737a560f1d20f6f3413bba08;p=horde.git add a crude way of returning the default branch and make sure it is selected even if it's not first alphabetically --- diff --git a/chora/browsedir.php b/chora/browsedir.php index 9bb132a84..610ad512f 100644 --- a/chora/browsedir.php +++ b/chora/browsedir.php @@ -55,8 +55,12 @@ foreach ($umap as $key => $val) { $url[$key] = Chora::url('browsedir', $where . '/', $arg); } +$branches = array(); if ($VC->hasFeature('branches')) { $branches = $dir->getBranches(); + if ($rev === null) { + $rev = $dir->getDefaultBranch(); + } } /* Print out the directory header. */ diff --git a/framework/Vcs/lib/Horde/Vcs/Cvs.php b/framework/Vcs/lib/Horde/Vcs/Cvs.php index 3d051d3f0..3ead7a116 100644 --- a/framework/Vcs/lib/Horde/Vcs/Cvs.php +++ b/framework/Vcs/lib/Horde/Vcs/Cvs.php @@ -334,6 +334,11 @@ class Horde_Vcs_Directory_Cvs extends Horde_Vcs_Directory return array('HEAD'); } + public function getDefaultBranch() + { + return 'HEAD'; + } + } /** diff --git a/framework/Vcs/lib/Horde/Vcs/Git.php b/framework/Vcs/lib/Horde/Vcs/Git.php index 46af74ca1..655acdb87 100644 --- a/framework/Vcs/lib/Horde/Vcs/Git.php +++ b/framework/Vcs/lib/Horde/Vcs/Git.php @@ -349,6 +349,14 @@ class Horde_Vcs_Directory_Git extends Horde_Vcs_Directory return array_keys($this->_rep->getBranchList()); } + /** + * @TODO ? + */ + public function getDefaultBranch() + { + return 'master'; + } + } /**