summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-07-21 21:01:58 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-08-16 15:03:38 +0900
commit2e04336b6718b4ad59f9563b388d34cde24704ed (patch)
tree6058e81b75fa6f6b8c2b85e0270013ab4f0532ae /lib
parent4a3777bf6ba78473ace61fbaa663faaa4e7068e3 (diff)
[rubygems/rubygems] Fix git source conservativeness
https://github.com/rubygems/rubygems/commit/9a0e0dfd5b
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/definition.rb1
-rw-r--r--lib/bundler/source/git.rb7
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 2fbd56e5d7..564530a98c 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -819,6 +819,7 @@ module Bundler
@specs_that_changed_sources << s if gemfile_source != lockfile_source
deps << dep if !dep.source || lockfile_source.include?(dep.source)
+ @unlock[:gems] << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source
# Replace the locked dependency's source with the equivalent source from the Gemfile
s.source = gemfile_source
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 4a9f3731bd..adbce5fce4 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -67,6 +67,13 @@ module Bundler
alias_method :==, :eql?
+ def include?(other)
+ other.is_a?(Git) && uri == other.uri &&
+ name == other.name &&
+ glob == other.glob &&
+ submodules == other.submodules
+ end
+
def to_s
begin
at = humanized_ref || current_branch