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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8cdb3477
Commit
8cdb3477
authored
Feb 08, 2018
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove allow_n_plus_1 from Git::Repository#branches_filter
parent
5edd94ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+8
-11
No files found.
lib/gitlab/git/repository.rb
View file @
8cdb3477
...
@@ -1614,17 +1614,14 @@ module Gitlab
...
@@ -1614,17 +1614,14 @@ module Gitlab
# Gitaly note: JV: Trying to get rid of the 'filter' option so we can implement this with 'git'.
# 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
)
def
branches_filter
(
filter:
nil
,
sort_by:
nil
)
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37464
branches
=
rugged
.
branches
.
each
(
filter
).
map
do
|
rugged_ref
|
branches
=
Gitlab
::
GitalyClient
.
allow_n_plus_1_calls
do
begin
rugged
.
branches
.
each
(
filter
).
map
do
|
rugged_ref
|
target_commit
=
Gitlab
::
Git
::
Commit
.
find
(
self
,
rugged_ref
.
target
)
begin
Gitlab
::
Git
::
Branch
.
new
(
self
,
rugged_ref
.
name
,
rugged_ref
.
target
,
target_commit
)
target_commit
=
Gitlab
::
Git
::
Commit
.
find
(
self
,
rugged_ref
.
target
)
rescue
Rugged
::
ReferenceError
Gitlab
::
Git
::
Branch
.
new
(
self
,
rugged_ref
.
name
,
rugged_ref
.
target
,
target_commit
)
# Omit invalid branch
rescue
Rugged
::
ReferenceError
end
# Omit invalid branch
end
.
compact
end
end
.
compact
end
sort_branches
(
branches
,
sort_by
)
sort_branches
(
branches
,
sort_by
)
end
end
...
...
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