提交 3c8c9129 编写于 作者: P Phil Hughes

Pulls back tags if any exist

上级 ed0f26c2
......@@ -253,15 +253,19 @@ class ProjectsController < Projects::ApplicationController
def refs
repository = @project.repository
tags = VersionSorter.rsort(repository.tag_names)
options = {
'Branches' => repository.branch_names,
'Tags' => VersionSorter.rsort(repository.tag_names)
}
if tags.any?
options['Tags'] = tags
end
# If reference is commit id - we should add it to branch/tag selectbox
if @ref && !options.flatten.include?(@ref) && @ref =~ /\A[0-9a-zA-Z]{6,52}\z/
options << { 'Commits' => @ref }
options['Commits'] = @ref
end
render json: options.to_json
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册