aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/source_list.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index ccb3ab1cec..30e1820eec 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -743,7 +743,7 @@ module Bundler
# Replace the locked dependency's source with the equivalent source from the Gemfile
dep = @dependencies.find {|d| s.satisfies?(d) }
- s.source = (dep && dep.source) || sources.get(s.source) || sources.default_source
+ s.source = (dep && dep.source) || sources.get_with_fallback(s.source)
next if @unlock[:sources].include?(s.source.name)
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index a4773397c7..6ea2910d18 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -101,6 +101,10 @@ module Bundler
source_list_for(source).find {|s| equivalent_source?(source, s) }
end
+ def get_with_fallback(source)
+ get(source) || default_source
+ end
+
def lock_sources
lock_other_sources + lock_rubygems_sources
end