Changed how the data is returned - we only care about the branch/tag name

This commit is contained in:
Phil Hughes 2016-11-03 12:16:15 +00:00 committed by Jacob Schatz
parent ba2089e017
commit f9750b4912
2 changed files with 5 additions and 4 deletions

View File

@ -94,8 +94,8 @@
link.className = 'is-active'; link.className = 'is-active';
} }
link.textContent = ref.name; link.textContent = ref;
link.dataset.ref = ref.name; link.dataset.ref = ref;
li.appendChild(link); li.appendChild(link);
} }

View File

@ -267,14 +267,15 @@ class ProjectsController < Projects::ApplicationController
end end
def refs def refs
branches = BranchesFinder.new(@repository, params).execute branches = BranchesFinder.new(@repository, params).execute.map(&:name)
options = { options = {
'Branches' => branches.take(100), 'Branches' => branches.take(100),
} }
unless @repository.tag_count.zero? unless @repository.tag_count.zero?
tags = TagsFinder.new(@repository, params).execute tags = TagsFinder.new(@repository, params).execute.map(&:name)
options['Tags'] = tags.take(100) options['Tags'] = tags.take(100)
end end