diff options
author | Homu <homu@barosl.com> | 2016-06-28 04:02:43 +0900 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-27 16:17:38 -0500 |
commit | b7eb3ba2e854226c7f94e14e2566b14b6ff22078 (patch) | |
tree | 85119833786aacd74f8ff3f412182a575b29115b | |
parent | cd49b4170a3d2910108cc16f7812ce12137ec45b (diff) | |
download | bundler-b7eb3ba2e854226c7f94e14e2566b14b6ff22078.tar.gz |
Auto merge of #4717 - bundler:seg-deinit-submodules, r=indirect
[GitProxy] Deinit submodules if they are not requested
(cherry picked from commit 5e88c8d494d40157dd1ec9b34be8aafe68431a90)
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 6 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | spec/update/git_spec.rb | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 9b0e95d18c..84d7fee6a9 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -123,7 +123,11 @@ module Bundler git_retry %(fetch --force --quiet --tags "#{path}") git "reset --hard #{@revision}" - git_retry "submodule update --init --recursive" if submodules + if submodules + git_retry "submodule update --init --recursive" + elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0") + git_retry "submodule deinit --all" + end 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 94426b68d9..644bbad80c 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -157,8 +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 - pending "This would require actually removing the submodule from the clone" + 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" |