/** * Get options for file * * @param Repository $repository * @param SourceCommit $commit * @param string $file * @return array */ function ac_gitolite_get_branches() { // prepare options for dropdown $repo_path = $this->active_repository->getRepositoryPathUrl(); $branches = ProjectGitolite::get_branches($repo_path); $file_options = new NamedList(); if (is_array($branches)) { foreach ($branches as $key => $value) { $file_options->add("branch_{$key}", array('text' => $value, 'url' => "#")); } } else { $file_options->add("no_branches", array('text' => "No Branches Added", 'url' => "#")); } /* $file_options->add('download', array( 'text' => lang('Download'), 'url' => $repository->getFileDownloadUrl($commit, $file) )); */ return $file_options->toArray(); }