Commit 000ec953 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Make branch filter support private

parent 7fbcdfb0
......@@ -80,16 +80,8 @@ module Gitlab
end
# Returns an Array of Branches
def branches(filter: nil, sort_by: nil)
branches = rugged.branches.each(filter).map do |rugged_ref|
begin
Gitlab::Git::Branch.new(self, rugged_ref.name, rugged_ref.target)
rescue Rugged::ReferenceError
# Omit invalid branch
end
end.compact
sort_branches(branches, sort_by)
def branches(sort_by: nil)
branches_filter(sort_by: sort_by)
end
def reload_rugged
......@@ -115,7 +107,7 @@ module Gitlab
if is_enabled
gitaly_ref_client.local_branches(sort_by: sort_by)
else
branches(filter: :local, sort_by: sort_by)
branches_filter(filter: :local, sort_by: sort_by)
end
end
end
......@@ -837,6 +829,19 @@ module Gitlab
private
# Gitaly note: JV: Trying to get rid of the 'filter' option so we can implement this with 'git'.
def branches_filter(filter: nil, sort_by: nil)
branches = rugged.branches.each(filter).map do |rugged_ref|
begin
Gitlab::Git::Branch.new(self, rugged_ref.name, rugged_ref.target)
rescue Rugged::ReferenceError
# Omit invalid branch
end
end.compact
sort_branches(branches, sort_by)
end
def raw_log(options)
default_options = {
limit: 10,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment