Class: Dragnet::MultiRepository
- Inherits:
-
BaseRepository
- Object
- BaseRepository
- Dragnet::MultiRepository
- Defined in:
- lib/dragnet/multi_repository.rb
Overview
This is a dummy class that acts as a placeholder when Dragnet is executed on a multi-repo set-up. Since there is no Git repository in the directory where git-repo runs git commands cannot be executed there only in the inner repositories.
This class's job is to raise a particular error when a git operation is attempted directly on this directory so that Dragnet can recognize the cause of the error and display it correctly.
It also acts as a collection of repositories. It stores a collection of Dragnet::Repository
objects, which point to the actual repositories (this is just so that the same repository isn't initialized multiple times).
Instance Attribute Summary collapse
-
#repositories ⇒ Object
readonly
Returns the value of attribute repositories.
Attributes inherited from BaseRepository
Instance Method Summary collapse
-
#initialize(path:) ⇒ MultiRepository
constructor
A new instance of MultiRepository.
-
#multi? ⇒ TrueClass
It always returns true.
Methods inherited from BaseRepository
#branch, #branches, #branches_with, #branches_with_head, #diff, #git, #head, #remote_uri_path
Constructor Details
#initialize(path:) ⇒ MultiRepository
Returns a new instance of MultiRepository.
23 24 25 26 |
# File 'lib/dragnet/multi_repository.rb', line 23 def initialize(path:) super @repositories = {} end |
Instance Attribute Details
#repositories ⇒ Object (readonly)
Returns the value of attribute repositories.
19 20 21 |
# File 'lib/dragnet/multi_repository.rb', line 19 def repositories @repositories end |
Instance Method Details
#multi? ⇒ TrueClass
Returns It always returns true.
29 30 31 |
# File 'lib/dragnet/multi_repository.rb', line 29 def multi? true end |