class R10K::Git::ShellGit::BareRepository

Create and manage Git bare repositories.

Public Class Methods

new(basedir, dirname) click to toggle source

@param basedir [String] The base directory of the Git repository @param dirname [String] The directory name of the Git repository

# File lib/r10k/git/shellgit/bare_repository.rb, line 9
def initialize(basedir, dirname)
  @path = Pathname.new(File.join(basedir, dirname))
end

Public Instance Methods

clone(remote) click to toggle source
# File lib/r10k/git/shellgit/bare_repository.rb, line 23
def clone(remote)
  git ['clone', '--mirror', remote, git_dir.to_s]
end
exist?() click to toggle source
# File lib/r10k/git/shellgit/bare_repository.rb, line 31
def exist?
  @path.exist?
end
fetch() click to toggle source
# File lib/r10k/git/shellgit/bare_repository.rb, line 27
def fetch
  git ['fetch', '--prune'], :git_dir => git_dir.to_s
end
git_dir() click to toggle source

@return [Pathname] The path to this Git repository

# File lib/r10k/git/shellgit/bare_repository.rb, line 14
def git_dir
  @path
end
objects_dir() click to toggle source

@return [Pathname] The path to the objects directory in this Git repository

# File lib/r10k/git/shellgit/bare_repository.rb, line 19
def objects_dir
  @path + "objects"
end