Class: Gitlab::Git::ObjectPool
- Inherits:
-
Object
- Object
- Gitlab::Git::ObjectPool
- Defined in:
- lib/gitlab/git/object_pool.rb
Constant Summary collapse
- GL_REPOSITORY =
GL_REPOSITORY has to be passed for Gitlab::Git::Repositories, but not used for ObjectPools.
""
Instance Attribute Summary collapse
-
#gl_project_path ⇒ Object
readonly
Returns the value of attribute gl_project_path.
-
#relative_path ⇒ Object
readonly
Returns the value of attribute relative_path.
-
#source_repository ⇒ Object
readonly
Returns the value of attribute source_repository.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
- #create ⇒ Object
- #fetch ⇒ Object
- #gitaly_object_pool ⇒ Object
-
#initialize(storage, relative_path, source_repository, gl_project_path) ⇒ ObjectPool
constructor
A new instance of ObjectPool.
- #link(to_link_repo) ⇒ Object
-
#repository ⇒ Object
Allows for reusing other RPCs by 'tricking' Gitaly to think its a repository.
- #to_gitaly_repository ⇒ Object
Constructor Details
#initialize(storage, relative_path, source_repository, gl_project_path) ⇒ ObjectPool
Returns a new instance of ObjectPool.
15 16 17 18 19 20 |
# File 'lib/gitlab/git/object_pool.rb', line 15 def initialize(storage, relative_path, source_repository, gl_project_path) @storage = storage @relative_path = relative_path @source_repository = source_repository @gl_project_path = gl_project_path end |
Instance Attribute Details
#gl_project_path ⇒ Object (readonly)
Returns the value of attribute gl_project_path
13 14 15 |
# File 'lib/gitlab/git/object_pool.rb', line 13 def gl_project_path @gl_project_path end |
#relative_path ⇒ Object (readonly)
Returns the value of attribute relative_path
13 14 15 |
# File 'lib/gitlab/git/object_pool.rb', line 13 def relative_path @relative_path end |
#source_repository ⇒ Object (readonly)
Returns the value of attribute source_repository
13 14 15 |
# File 'lib/gitlab/git/object_pool.rb', line 13 def source_repository @source_repository end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage
13 14 15 |
# File 'lib/gitlab/git/object_pool.rb', line 13 def storage @storage end |
Instance Method Details
#create ⇒ Object
22 23 24 |
# File 'lib/gitlab/git/object_pool.rb', line 22 def create object_pool_service.create(source_repository) end |
#fetch ⇒ Object
43 44 45 |
# File 'lib/gitlab/git/object_pool.rb', line 43 def fetch object_pool_service.fetch(source_repository) end |
#gitaly_object_pool ⇒ Object
30 31 32 |
# File 'lib/gitlab/git/object_pool.rb', line 30 def gitaly_object_pool Gitaly::ObjectPool.new(repository: to_gitaly_repository) end |
#link(to_link_repo) ⇒ Object
26 27 28 |
# File 'lib/gitlab/git/object_pool.rb', line 26 def link(to_link_repo) object_pool_service.link_repository(to_link_repo) end |
#repository ⇒ Object
Allows for reusing other RPCs by 'tricking' Gitaly to think its a repository
39 40 41 |
# File 'lib/gitlab/git/object_pool.rb', line 39 def repository @repository ||= Gitlab::Git::Repository.new(storage, relative_path, GL_REPOSITORY, gl_project_path) end |
#to_gitaly_repository ⇒ Object
34 35 36 |
# File 'lib/gitlab/git/object_pool.rb', line 34 def to_gitaly_repository Gitlab::GitalyClient::Util.repository(storage, relative_path, GL_REPOSITORY, gl_project_path) end |