diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 583edf8e..614582fa 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -14,11 +14,11 @@ class RepositoriesController < ApplicationController end def branches - @branches = @project.repo.heads.sort_by(&:name) + @branches = @project.branches end def tags - @tags = @project.repo.tags.sort_by(&:name).reverse + @tags = @project.tags end def archive diff --git a/app/roles/repository.rb b/app/roles/repository.rb index e7e57b0e..1f44481e 100644 --- a/app/roles/repository.rb +++ b/app/roles/repository.rb @@ -50,11 +50,21 @@ module Repository repo.branches.collect(&:name).sort end + # Returns an Array of Branches + def branches + repo.branches.sort_by(&:name) + end + # Returns an Array of tag names def tag_names repo.tags.collect(&:name).sort.reverse end + # Returns an Array of Tags + def tags + repo.tags.sort_by(&:name).reverse + end + # Returns an Array of branch and tag names def ref_names [branch_names + tag_names].flatten