Skip to content

Commit de61e14

Browse files
committed
Increment version to 1.3.1 pre and add :lfs option to git clone
1 parent a223fcf commit de61e14

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.3.0
1+
1.3.1.pre.0
22

git.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
66
s.license = 'MIT'
77
s.name = 'git'
88
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.'
9-
s.version = '1.3.0'
9+
s.version = '1.3.1.pre.0'
1010

1111
s.require_paths = ['lib']
1212
s.required_ruby_version = '>= 1.9'

lib/git/lib.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def init(opts={})
5353
# :path:: directory where the repo will be cloned
5454
# :remote:: name of remote (rather than 'origin')
5555
# :recursive:: after the clone is created, initialize all submodules within, using their default settings.
56+
# :lfs:: use 'git lfs clone' command instead of 'git clone' (requires git-lfs client to be installed)
5657
#
5758
# TODO - make this work with SSH password or auth_key
5859
#
@@ -73,7 +74,23 @@ def clone(repository, name, opts = {})
7374
arr_opts << repository
7475
arr_opts << clone_dir
7576

76-
command('clone', arr_opts)
77+
start_time = Time.now
78+
79+
if opts[:lfs]
80+
# verify git lfs installed
81+
if !(/git-lfs/.match(command('lfs version')))
82+
raise "clone: attempted to clone with git lfs, but it is not installed."
83+
end
84+
command('lfs clone', arr_opts)
85+
else
86+
command('clone', arr_opts)
87+
end
88+
89+
end_time = Time.now
90+
91+
sec_diff = (start_time - end_time).to_i.abs
92+
93+
puts "Cloned in #{sec_diff} seconds."
7794

7895
opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir}
7996
end

lib/git/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module Git
22

33
# The current gem version
44
# @return [String] the current gem version.
5-
VERSION='1.3.0'
5+
VERSION='1.3.1.pre.0'
66

77
end

0 commit comments

Comments
 (0)