add a crude way of returning the default branch and make sure it is selected even...
authorChuck Hagenbuch <chuck@horde.org>
Sat, 13 Jun 2009 01:54:52 +0000 (21:54 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 13 Jun 2009 01:54:52 +0000 (21:54 -0400)
chora/browsedir.php
framework/Vcs/lib/Horde/Vcs/Cvs.php
framework/Vcs/lib/Horde/Vcs/Git.php

index 9bb132a..610ad51 100644 (file)
@@ -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. */
index 3d051d3..3ead7a1 100644 (file)
@@ -334,6 +334,11 @@ class Horde_Vcs_Directory_Cvs extends Horde_Vcs_Directory
         return array('HEAD');
     }
 
+    public function getDefaultBranch()
+    {
+        return 'HEAD';
+    }
+
 }
 
 /**
index 46af74c..655acdb 100644 (file)
@@ -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';
+    }
+
 }
 
 /**