# File lib/git/lib.rb, line 44 def clone(repository, name, opts = {}) @path = opts[:path] || '.' clone_dir = opts[:path] ? File.join(@path, name) : name arr_opts = [] arr_opts << "--bare" if opts[:bare] arr_opts << "-o" << opts[:remote] if opts[:remote] arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0 arr_opts << '--' arr_opts << repository arr_opts << clone_dir command('clone', arr_opts) opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir} end