akester/storehouse

Fork Project

7baacabb3c5a77dfa7ac1838d8c64ae75ebc0000

Authored By: Andrew Kester Date: July 7, 2017 7:24 pm

Fix sidebar controller.

The way things were linked, it was impossible to view the commits for a branch, since this would link back to the default branch rather than the current branch.

src/StorehouseBundle/Controller/_Partials/BrowserSidebarController.php
68 68
             ));
69 69
         $links[] = $link;
70 70
 
71
-        if ($context->isCommit()) {
72
-            $commit = $context->wrapper->getDefault('branch');
73
-        } else {
74
-            $commit = $context->commit;
75
-        }
76
-
71 77
         $link = new SidebarLink();
72 78
         $link->icon = 'fa fa-history';
73 79
         $link->name = 'Commits';
74 80
         $link->link = $this->generateUrl('project/log',
75 81
             array(
76 82
                 'project' => $context->project->getName(),
83
-                'commit' => $commit
77
+                'commit' => $context->commit
78 84
             ));
79 85
         $links[] = $link;
80 86
 
81 87