module Git

def self.export(repository, name, options = {})

remote, 'origin.'
since the .git info will be deleted anyway; always uses the default
See +clone+ for options. Does not obey the :remote option,

directory.
is specified) into the +name+ directory, then remove all traces of git from the
Export the current HEAD (or a branch, if options[:branch]
def self.export(repository, name, options = {})
  options.delete(:remote)
  repo = clone(repository, name, {:depth => 1}.merge(options))
  repo.checkout("origin/#{options[:branch]}") if options[:branch]
  Dir.chdir(repo.dir.to_s) { FileUtils.rm_r '.git' }
end