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
```
This commit is contained in:
parent
db759c5d9c
commit
7a2325e43c
|
|
@ -781,7 +781,7 @@ module Ci
|
|||
end
|
||||
|
||||
def git_ref
|
||||
strong_memoize(:git_pref) do
|
||||
strong_memoize(:git_ref) do
|
||||
if merge_request_event?
|
||||
##
|
||||
# In the future, we're going to change this ref to
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue