diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-14 11:31:24 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-14 11:31:24 +0300 |
commit | 3ed4a1b3aadd50b47181312b49911d2a770c4c82 (patch) | |
tree | daa0fb51a3dd0480332d5befa01c44713a532bf7 /lib/gitlab | |
parent | 89ab32c6b20b9a0e8cde9d7f28759db8f53c7ffb (diff) |
HasLocalBranches check is done by Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/217
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/git/repository.rb | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 4410b81ed9a..dfdd151aaba 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -235,18 +235,6 @@ module Gitlab # This refs by default not visible in project page and not cloned to client side. alias_method :has_visible_content?, :has_local_branches? - def has_local_branches_rugged? - rugged.branches.each(:local).any? do |ref| - begin - ref.name && ref.target # ensures the branch is valid - - true - rescue Rugged::ReferenceError - false - end - end - end - # Returns the number of valid tags def tag_count gitaly_migrate(:tag_names) do |is_enabled| @@ -1573,12 +1561,8 @@ module Gitlab private def uncached_has_local_branches? - gitaly_migrate(:has_local_branches, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| - if is_enabled - gitaly_repository_client.has_local_branches? - else - has_local_branches_rugged? - end + wrapped_gitaly_errors do + gitaly_repository_client.has_local_branches? end end |