Create and manage Git bare repositories.
@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
# File lib/r10k/git/shellgit/bare_repository.rb, line 23 def clone(remote) proxy = R10K::Git.get_proxy_for_remote(remote) R10K::Git.with_proxy(proxy) do git ['clone', '--mirror', remote, git_dir.to_s] end end
# File lib/r10k/git/shellgit/bare_repository.rb, line 40 def exist? @path.exist? end
# File lib/r10k/git/shellgit/bare_repository.rb, line 31 def fetch(remote_name='origin') remote = remotes[remote_name] proxy = R10K::Git.get_proxy_for_remote(remote) R10K::Git.with_proxy(proxy) do git ['fetch', remote_name, '--prune'], :git_dir => git_dir.to_s end end
@return [Pathname] The path to this Git repository
# File lib/r10k/git/shellgit/bare_repository.rb, line 14 def git_dir @path end
@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