diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-06-24 18:36:51 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-24 18:37:18 -0500 |
commit | 7d9146bae10a21cb195c8dc376fe54bee87a8d7a (patch) | |
tree | 13d85753787c6410313fe54dc93569bd01fa0f02 | |
parent | 378602f073f808046741a829903d6ea6104f619a (diff) | |
download | bundler-7d9146bae10a21cb195c8dc376fe54bee87a8d7a.tar.gz |
[GitProxy] Deinit submodules if they are not requested
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 6 | ||||
-rw-r--r-- | 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" |