Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't warn when deinit'ing submodules #3969

Merged
merged 1 commit into from Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion bundler/lib/bundler/source/git/git_proxy.rb
Expand Up @@ -136,7 +136,9 @@ def copy_to(destination, submodules = false)
if submodules
git_retry "submodule update --init --recursive", :dir => destination
elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
git_retry "submodule deinit --all --force", :dir => destination
inner_command = "git -C $toplevel submodule deinit --force $sm_path"
inner_command = inner_command.gsub("$") { '\$' } unless Bundler::WINDOWS
git_retry "submodule foreach --quiet \"#{inner_command}\"", :dir => destination
end
end

Expand Down
18 changes: 18 additions & 0 deletions bundler/spec/install/gemfile/git_spec.rb
Expand Up @@ -864,6 +864,24 @@
expect(the_bundle).to include_gems "has_submodule 1.0"
end

it "does not warn when deiniting submodules" do
build_git "submodule", "1.0"
build_git "has_submodule", "1.0"

sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", :dir => lib_path("has_submodule-1.0")
sys_exec "git commit -m \"submodulator\"", :dir => lib_path("has_submodule-1.0")

install_gemfile <<-G
git "#{lib_path("has_submodule-1.0")}" do
gem "has_submodule"
end
G
expect(err).to be_empty

expect(the_bundle).to include_gems "has_submodule 1.0"
expect(the_bundle).to_not include_gems "submodule 1.0"
end

it "handles implicit updates when modifying the source info" do
git = build_git "foo"

Expand Down