Don't cache a nil repository root ref to prevent caching issues
This commit is contained in:
parent
b236348388
commit
8b727fea81
|
@ -492,12 +492,8 @@ class Repository
|
|||
end
|
||||
|
||||
def root_ref
|
||||
if raw_repository
|
||||
raw_repository.root_ref
|
||||
else
|
||||
# When the repo does not exist we raise this error so no data is cached.
|
||||
raise Gitlab::Git::Repository::NoRepository
|
||||
end
|
||||
# When the repo does not exist, or there is no root ref, we raise this error so no data is cached.
|
||||
raw_repository&.root_ref or raise Gitlab::Git::Repository::NoRepository # rubocop:disable Style/AndOr
|
||||
end
|
||||
cache_method :root_ref
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Don't cache a nil repository root ref to prevent caching issues
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
Loading…
Reference in New Issue