diff options
author | Robert Speicher <robert@gitlab.com> | 2018-02-08 19:59:34 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-02-08 19:59:34 +0000 |
commit | c5ad5a082f85d2bcb5bb709198ac70812ae6c378 (patch) | |
tree | e0d6332ddf4ce580b10433489924bac2a14e618c | |
parent | 5edd94ae75c103d468b8b307e37321b92bde6080 (diff) | |
parent | 8cdb3477b091e5c4ce08ef9f8caa65c7f5d925af (diff) | |
download | gitlab-ce-c5ad5a082f85d2bcb5bb709198ac70812ae6c378.tar.gz |
Merge branch 'fix/remove-n-plus-one-from-branches-filter' into 'master'
Remove allow_n_plus_1 from Git::Repository#branches_filter
See merge request gitlab-org/gitlab-ce!17012
-rw-r--r-- | lib/gitlab/git/repository.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 6761fb0937a..5f014e43c6f 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1614,17 +1614,14 @@ module Gitlab # 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) - # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37464 - branches = Gitlab::GitalyClient.allow_n_plus_1_calls do - rugged.branches.each(filter).map do |rugged_ref| - begin - target_commit = Gitlab::Git::Commit.find(self, rugged_ref.target) - Gitlab::Git::Branch.new(self, rugged_ref.name, rugged_ref.target, target_commit) - rescue Rugged::ReferenceError - # Omit invalid branch - end - end.compact - end + branches = rugged.branches.each(filter).map do |rugged_ref| + begin + target_commit = Gitlab::Git::Commit.find(self, rugged_ref.target) + Gitlab::Git::Branch.new(self, rugged_ref.name, rugged_ref.target, target_commit) + rescue Rugged::ReferenceError + # Omit invalid branch + end + end.compact sort_branches(branches, sort_by) end |