debian-mirror-gitlab/app/helpers/branches_helper.rb

18 lines
410 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
module BranchesHelper
def project_branches
options_for_select(@project.repository.branch_names, @project.default_branch)
end
2017-08-17 22:00:37 +05:30
def protected_branch?(project, branch)
ProtectedBranch.protected?(project, branch.name)
end
2018-03-17 18:26:18 +05:30
def diverging_count_label(count)
if count >= Repository::MAX_DIVERGING_COUNT
"#{Repository::MAX_DIVERGING_COUNT - 1}+"
else
count.to_s
end
end
2014-09-02 18:07:02 +05:30
end