summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-06-28 04:02:43 +0900
committerHomu <homu@barosl.com>2016-06-28 04:02:43 +0900
commit5e88c8d494d40157dd1ec9b34be8aafe68431a90 (patch)
tree7551500aedfdd6d277634fe82dc1dbb246eb8434
parentb44d763965d3551a734a57fd828d13f9908d0bad (diff)
parent31ad5f7c6b853c3d391749128f81bde7d904442a (diff)
downloadbundler-5e88c8d494d40157dd1ec9b34be8aafe68431a90.tar.gz
Auto merge of #4717 - bundler:seg-deinit-submodules, r=indirect
[GitProxy] Deinit submodules if they are not requested
-rw-r--r--lib/bundler/source/git/git_proxy.rb6
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/update/git_spec.rb3
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"