diff options
author | Stan Hu <stanhu@gmail.com> | 2019-03-28 02:15:26 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-03-28 02:17:25 +0300 |
commit | 7a2325e43c1fe726b4affc544449a763fb52b9e7 (patch) | |
tree | c04c49e55a30e10dc0030a0527cad8ae64570204 /lib | |
parent | db759c5d9ca3ba9c1610b05d6725c1427d653bef (diff) |
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
```
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/gitaly_client.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |