Skip to content

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

Douwe Maan requested to merge dm-dont-cache-nil-root-ref into master

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/43214.

I'm still not sure why non-empty projects ended up with a nil root_ref stored in the cache, because I can't figure out why Gitlab::Git::Repository#root_ref would return nil if Gitlab::Git::Repository#branch_names (which is not cached) is non-empty, but this patch will at least prevent similar issues in the future, by refusing to cache a nil root_ref.

Merge request reports