Commit a3809745 authored by Patrick Steinhardt's avatar Patrick Steinhardt

gitaly: Use `#blank?` to check whether the hook env is populated

The check whether the hook env is active needs to check whether the
hook env is set at all, and if it is, also whether it carries any
values. This is currently done in two calls, but can be improved to
simply use `#blank?`.
parent 51f18dec
......@@ -246,9 +246,7 @@ module Gitlab
def self.route_to_primary
return {} unless Gitlab::SafeRequestStore.active?
return {} unless Gitlab::SafeRequestStore[:gitlab_git_env]
return {} if Gitlab::SafeRequestStore[:gitlab_git_env].empty?
return {} if Gitlab::SafeRequestStore[:gitlab_git_env].blank?
{ 'gitaly-route-repository-accessor-policy' => 'primary-only' }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment