diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-06-24 20:05:57 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-27 11:06:19 -0500 |
commit | 31ad5f7c6b853c3d391749128f81bde7d904442a (patch) | |
tree | 3200a7be31a08f8b8c6876ef6f06c70e88bc0ebc | |
parent | 7d9146bae10a21cb195c8dc376fe54bee87a8d7a (diff) | |
download | bundler-31ad5f7c6b853c3d391749128f81bde7d904442a.tar.gz |
[GitProxy] Only try and submodule deinit on git 2.9.0+seg-deinit-submodules
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | spec/update/git_spec.rb | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 9c32501d40..84d7fee6a9 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -125,7 +125,7 @@ module Bundler if submodules git_retry "submodule update --init --recursive" - else + elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0") git_retry "submodule deinit --all" end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7aaaa0871c..d780a3f27b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -76,6 +76,7 @@ RSpec.configure do |config| config.filter_run_excluding :ruby => LessThanProc.with(RUBY_VERSION) config.filter_run_excluding :rubygems => LessThanProc.with(Gem::VERSION) + config.filter_run_excluding :git => LessThanProc.with(`git --version`.gsub("git version", "").strip) config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master") config.filter_run :focused => true unless ENV["CI"] diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index 4252010a7d..644bbad80c 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -157,7 +157,7 @@ describe "bundle update" do expect(out).to eq("GIT") end - it "it unlocks the source when submodules are removed from git source" do + it "unlocks the source when submodules are removed from git source", :git => ">= 2.9.0" do install_gemfile <<-G, :expect_err => true git "#{lib_path("has_submodule-1.0")}", :submodules => true do gem "has_submodule" |