Commit 35ee6307 authored by Stan Hu's avatar Stan Hu

Merge branch 'dm-dont-cache-nil-root-ref' into 'master'

Don't cache a nil repository root ref to prevent caching issues

See merge request gitlab-org/gitlab-ce!17179
parents 6fdfc20d 8b727fea
......@@ -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
......
---
title: Don't cache a nil repository root ref to prevent caching issues
merge_request:
author:
type: fixed
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