Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/gitlab_git/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid multi-line chains of blocks.

branch.name
end.sort_by(&:name)
end

Expand Down