diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/definition.rb | 16 | ||||
-rw-r--r-- | lib/bundler/runtime.rb | 1 |
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index d6bbb97606..99cf1ee4e5 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -123,7 +123,7 @@ module Bundler def create_gem_version_promoter locked_specs = - if @unlocking && @locked_specs.empty? && !@lockfile_contents.empty? + if unlocking? && @locked_specs.empty? && !@lockfile_contents.empty? # Definition uses an empty set of locked_specs to indicate all gems # are unlocked, but GemVersionPromoter needs the locked_specs # for conservative comparison. @@ -226,7 +226,7 @@ module Bundler def resolve @resolve ||= begin last_resolve = converge_locked_specs - if Bundler.settings[:frozen] || (!@unlocking && nothing_changed?) + if Bundler.settings[:frozen] || (!unlocking? && nothing_changed?) Bundler.ui.debug("Found no changes, using resolution from the lockfile") last_resolve else @@ -295,7 +295,7 @@ module Bundler end end - preserve_unknown_sections ||= !updating_major && (Bundler.settings[:frozen] || !@unlocking) + preserve_unknown_sections ||= !updating_major && (Bundler.settings[:frozen] || !unlocking?) return if lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections) if Bundler.settings[:frozen] @@ -526,14 +526,18 @@ module Bundler attr_reader :sources private :sources - private - def nothing_changed? !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes end + def unlocking? + @unlocking + end + + private + def change_reason - if @unlocking + if unlocking? unlock_reason = @unlock.reject {|_k, v| Array(v).empty? }.map do |k, v| if v == true k.to_s diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index fdd3d227e3..6ccb0d89b5 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -127,6 +127,7 @@ module Bundler definition_method :requires def lock(opts = {}) + return if @definition.nothing_changed? && !@definition.unlocking? @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections]) end |