Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
000ec953
Commit
000ec953
authored
Jul 14, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make branch filter support private
parent
7fbcdfb0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+16
-11
No files found.
lib/gitlab/git/repository.rb
View file @
000ec953
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment