diff --git a/VERSION b/VERSION index 1e754301..9349c38b 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -1.3.0 +1.3.1.pre.0 diff --git a/git.gemspec b/git.gemspec index 5e90626e..ced83d12 100644 --- a/git.gemspec +++ b/git.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |s| s.license = 'MIT' s.name = 'git' s.summary = 'Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary.' - s.version = '1.3.0' + s.version = '1.3.1.pre.0' s.require_paths = ['lib'] s.required_ruby_version = '>= 1.9' diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 777e42ea..2a890613 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -53,6 +53,7 @@ def init(opts={}) # :path:: directory where the repo will be cloned # :remote:: name of remote (rather than 'origin') # :recursive:: after the clone is created, initialize all submodules within, using their default settings. + # :lfs:: use 'git lfs clone' command instead of 'git clone' (requires git-lfs client to be installed) # # TODO - make this work with SSH password or auth_key # @@ -73,7 +74,23 @@ def clone(repository, name, opts = {}) arr_opts << repository arr_opts << clone_dir - command('clone', arr_opts) + start_time = Time.now + + if opts[:lfs] + # verify git lfs installed + if !(/git-lfs/.match(command('lfs version'))) + raise "clone: attempted to clone with git lfs, but it is not installed." + end + command('lfs clone', arr_opts) + else + command('clone', arr_opts) + end + + end_time = Time.now + + sec_diff = (start_time - end_time).to_i.abs + + puts "Cloned in #{sec_diff} seconds." opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir} end diff --git a/lib/git/version.rb b/lib/git/version.rb index 4f4add63..46746974 100644 --- a/lib/git/version.rb +++ b/lib/git/version.rb @@ -2,6 +2,6 @@ module Git # The current gem version # @return [String] the current gem version. - VERSION='1.3.0' + VERSION='1.3.1.pre.0' end