From 74a9e395d180307d1fd2de87430420de7cda2660 Mon Sep 17 00:00:00 2001 From: AustP Date: Mon, 29 Dec 2014 15:34:38 -0700 Subject: [PATCH] Ensure that we don't have dupes in branches list --- lib/gitlab_git/repository.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/gitlab_git/repository.rb b/lib/gitlab_git/repository.rb index f1b5606..523df9b 100644 --- a/lib/gitlab_git/repository.rb +++ b/lib/gitlab_git/repository.rb @@ -47,13 +47,15 @@ def rugged # Returns an Array of branch names # sorted by name ASC def branch_names - branches.map(&:name) + branches.uniq.map(&:name) end # Returns an Array of Branches def branches rugged.branches.map do |rugged_ref| Branch.new(rugged_ref.name, rugged_ref.target) + end.uniq do |branch| + branch.name end.sort_by(&:name) end