diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /lib/gitlab/gl_repository.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'lib/gitlab/gl_repository.rb')
-rw-r--r-- | lib/gitlab/gl_repository.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab/gl_repository.rb b/lib/gitlab/gl_repository.rb index 54dca93a891..352a93817be 100644 --- a/lib/gitlab/gl_repository.rb +++ b/lib/gitlab/gl_repository.rb @@ -4,6 +4,8 @@ module Gitlab class GlRepository include Singleton + # TODO: Refactor these constants into proper classes + # https://gitlab.com/gitlab-org/gitlab/-/issues/259008 PROJECT = RepoType.new( name: :project, access_checker_class: Gitlab::GitAccessProject, @@ -12,8 +14,12 @@ module Gitlab WIKI = RepoType.new( name: :wiki, access_checker_class: Gitlab::GitAccessWiki, - repository_resolver: -> (container) { ::Repository.new(container.wiki.full_path, container, shard: container.wiki.repository_storage, disk_path: container.wiki.disk_path, repo_type: WIKI) }, - project_resolver: -> (container) { container.is_a?(Project) ? container : nil }, + repository_resolver: -> (container) do + wiki = container.is_a?(Wiki) ? container : container.wiki # Also allow passing a Project, Group, or Geo::DeletedProject + ::Repository.new(wiki.full_path, wiki, shard: wiki.repository_storage, disk_path: wiki.disk_path, repo_type: WIKI) + end, + container_class: ProjectWiki, + project_resolver: -> (wiki) { wiki.try(:project) }, suffix: :wiki ).freeze SNIPPET = RepoType.new( |