Method: Cir::GitRepository.create

Defined in:
lib/cir/git_repository.rb

.create(rootPath) ⇒ Object

Create new git repository



23
24
25
26
27
28
29
30
31
# File 'lib/cir/git_repository.rb', line 23

def self.create(rootPath)
  raise Cir::Exception::RepositoryExists, "Path #{rootPath} already exists." if Dir.exists?(rootPath)

  # Without remote we will create blank new repository
  Rugged::Repository.init_at(rootPath)

  # And return our own wrapper on top of the underlying Rugged object
  Cir::GitRepository.new(rootPath)
end