Sha256: 9fcd2f0dc51d3825fe981606ef32e444f500b1a74c7c4ab6b588c00504df46a6

Contents?: true

Size: 710 Bytes

Versions: 5

Compression:

Stored size: 710 Bytes

Contents

require 'r10k/git/shellgit'
require 'r10k/git/shellgit/base_repository'

# Create and manage Git bare repositories.
class R10K::Git::ShellGit::BareRepository < R10K::Git::ShellGit::BaseRepository

  # @return [Pathname] The path to this Git repository
  def git_dir
    @path
  end

  # @param basedir [String] The base directory of the Git repository
  # @param dirname [String] The directory name of the Git repository
  def initialize(basedir, dirname)
    @path = Pathname.new(File.join(basedir, dirname))
  end

  def clone(remote)
    git ['clone', '--mirror', remote, git_dir.to_s]
  end

  def fetch
    git ['fetch', '--prune'], :git_dir => git_dir.to_s
  end

  def exist?
    @path.exist?
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
r10k-2.0.3 lib/r10k/git/shellgit/bare_repository.rb
r10k-2.0.2 lib/r10k/git/shellgit/bare_repository.rb
r10k-2.0.1 lib/r10k/git/shellgit/bare_repository.rb
r10k-2.0.0 lib/r10k/git/shellgit/bare_repository.rb
r10k-1.5.1 lib/r10k/git/shellgit/bare_repository.rb