Class: R10K::Git::ShellGit::BareRepository
- Inherits:
-
BaseRepository
- Object
- BaseRepository
- R10K::Git::ShellGit::BareRepository
- Defined in:
- lib/r10k/git/shellgit/bare_repository.rb
Overview
Create and manage Git bare repositories.
Constant Summary
Constants included from Logging
Instance Method Summary collapse
- #clone(remote) ⇒ Object
- #exist? ⇒ Boolean
- #fetch ⇒ Object
-
#git_dir ⇒ Pathname
The path to this Git repository.
-
#initialize(basedir, dirname) ⇒ BareRepository
constructor
A new instance of BareRepository.
Methods inherited from BaseRepository
#branches, #ref_type, #resolve, #tags
Methods included from Logging
debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level
Constructor Details
#initialize(basedir, dirname) ⇒ BareRepository
Returns a new instance of BareRepository.
14 15 16 |
# File 'lib/r10k/git/shellgit/bare_repository.rb', line 14 def initialize(basedir, dirname) @path = Pathname.new(File.join(basedir, dirname)) end |
Instance Method Details
#clone(remote) ⇒ Object
18 19 20 |
# File 'lib/r10k/git/shellgit/bare_repository.rb', line 18 def clone(remote) git ['clone', '--mirror', remote, git_dir.to_s] end |
#exist? ⇒ Boolean
26 27 28 |
# File 'lib/r10k/git/shellgit/bare_repository.rb', line 26 def exist? @path.exist? end |
#fetch ⇒ Object
22 23 24 |
# File 'lib/r10k/git/shellgit/bare_repository.rb', line 22 def fetch git ['fetch', '--prune'], :git_dir => git_dir.to_s end |
#git_dir ⇒ Pathname
Returns The path to this Git repository.
8 9 10 |
# File 'lib/r10k/git/shellgit/bare_repository.rb', line 8 def git_dir @path end |