summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-14 10:44:33 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-14 10:44:33 +0200
commit15f0cef1d026b161ecf6ffe5021e28f95cbd69f3 (patch)
tree2071c606c985c6bd6a60d2a9e7ee2d3d4ed94251
parent3ed4a1b3aadd50b47181312b49911d2a770c4c82 (diff)
downloadgitlab-ce-15f0cef1d026b161ecf6ffe5021e28f95cbd69f3.tar.gz
Local branches go through Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/217
-rw-r--r--lib/gitlab/git/repository.rb22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index dfdd151aaba..eb5d6318dcb 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -190,12 +190,8 @@ module Gitlab
end
def local_branches(sort_by: nil)
- gitaly_migrate(:local_branches, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
- if is_enabled
- gitaly_ref_client.local_branches(sort_by: sort_by)
- else
- branches_filter(filter: :local, sort_by: sort_by)
- end
+ wrapped_gitaly_errors do
+ gitaly_ref_client.local_branches(sort_by: sort_by)
end
end
@@ -1682,20 +1678,6 @@ module Gitlab
}
end
- # 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
- 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
-
def git_merged_branch_names(branch_names, root_sha)
git_arguments =
%W[branch --merged #{root_sha}