From 7d9146bae10a21cb195c8dc376fe54bee87a8d7a Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Fri, 24 Jun 2016 18:36:51 -0500 Subject: [GitProxy] Deinit submodules if they are not requested --- lib/bundler/source/git/git_proxy.rb | 6 +++++- spec/update/git_spec.rb | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 9b0e95d18c..9c32501d40 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" + else + git_retry "submodule deinit --all" + end end end diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index 94426b68d9..4252010a7d 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -158,7 +158,6 @@ describe "bundle update" do 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" install_gemfile <<-G, :expect_err => true git "#{lib_path("has_submodule-1.0")}", :submodules => true do gem "has_submodule" -- cgit v1.2.1