From f9750b4912c6f0e4c7b0b7d213f95223d5d1a593 Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Thu, 3 Nov 2016 12:16:15 +0000
Subject: [PATCH] Changed how the data is returned - we only care about the
 branch/tag name

---
 app/assets/javascripts/project.js      | 4 ++--
 app/controllers/projects_controller.rb | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/assets/javascripts/project.js b/app/assets/javascripts/project.js
index 7ac070a9c37..e7db0620848 100644
--- a/app/assets/javascripts/project.js
+++ b/app/assets/javascripts/project.js
@@ -94,8 +94,8 @@
                 link.className = 'is-active';
               }
 
-              link.textContent = ref.name;
-              link.dataset.ref = ref.name;
+              link.textContent = ref;
+              link.dataset.ref = ref;
 
               li.appendChild(link);
             }
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 6affadfa0a6..d7bc31b0718 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -267,14 +267,15 @@ class ProjectsController < Projects::ApplicationController
   end
 
   def refs
-    branches = BranchesFinder.new(@repository, params).execute
+    branches = BranchesFinder.new(@repository, params).execute.map(&:name)
 
     options = {
       'Branches' => branches.take(100),
     }
 
     unless @repository.tag_count.zero?
-      tags = TagsFinder.new(@repository, params).execute
+      tags = TagsFinder.new(@repository, params).execute.map(&:name)
+
       options['Tags'] = tags.take(100)
     end
 
-- 
GitLab