From 7a2325e43c1fe726b4affc544449a763fb52b9e7 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 27 Mar 2019 18:15:26 -0500 Subject: Guard against nested allows with ref name caching This avoids the case: ``` allow_ref_name_caching do allow_ref_name_caching do # using-feature end end ``` --- lib/gitlab/gitaly_client.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index bc2f7693fdc..42195f566eb 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -302,6 +302,7 @@ module Gitlab # branch, this method allows caching of the ref name directly. def self.allow_ref_name_caching return yield unless Gitlab::SafeRequestStore.active? + return yield if ref_name_caching_allowed? begin Gitlab::SafeRequestStore[:allow_ref_name_caching] = true -- cgit v1.2.1