summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb15
-rw-r--r--lib/bundler/lazy_specification.rb8
2 files changed, 9 insertions, 14 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 1d024032bb..2e1192d46e 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -147,7 +147,6 @@ module Bundler
@current_platform_missing = add_current_platform unless Bundler.frozen_bundle?
- converge_path_sources_to_gemspec_sources
@path_changes = converge_paths
@source_changes = converge_sources
@@ -842,7 +841,7 @@ module Bundler
def specs_for_source_changed?(source)
locked_index = Index.new
- locked_index.use(@locked_specs.select {|s| source.can_lock?(s) })
+ locked_index.use(@locked_specs.select {|s| s.replace_source_with!(source) })
!locked_index.subset?(source.specs)
rescue PathError, GitError => e
@@ -904,18 +903,6 @@ module Bundler
end
end
- def converge_path_source_to_gemspec_source(source)
- return source unless source.instance_of?(Source::Path)
- gemspec_source = sources.path_sources.find {|s| s == source }
- gemspec_source || source
- end
-
- def converge_path_sources_to_gemspec_sources
- @locked_specs.each do |spec|
- spec.source &&= converge_path_source_to_gemspec_source(spec.source)
- end
- end
-
def converge_sources
# Replace the sources from the Gemfile with the sources from the Gemfile.lock,
# if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 77c0563ac6..e617d32410 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -175,6 +175,14 @@ module Bundler
@force_ruby_platform = true
end
+ def replace_source_with!(gemfile_source)
+ return unless gemfile_source.can_lock?(self)
+
+ @source = gemfile_source
+
+ true
+ end
+
private
def use_exact_resolved_specifications?