summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-11-13 21:28:20 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-11-13 21:28:20 -0600
commitfa2fd9bee9f7075d45aa105378391abe0d83b6e9 (patch)
treebdcc40e7cedb4394129fe19713107a8253ce185a
parent27bdbcfa73f6387e0d8d9e16768a0052d209a1fd (diff)
downloadbundler-fa2fd9bee9f7075d45aa105378391abe0d83b6e9.tar.gz
Update vendored Molinillo to 0.5.4seg-molinillo-0.5.4
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb2
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb22
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
index 1880df2e10..7b3065236b 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Bundler::Molinillo
# The version of Bundler::Molinillo.
- VERSION = '0.5.3'.freeze
+ VERSION = '0.5.4'.freeze
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
index 2686a8ee70..da1ac5aef0 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
@@ -194,18 +194,20 @@ module Bundler::Molinillo
def state_index_for_unwind
current_requirement = requirement
existing_requirement = requirement_for_existing_name(name)
- until current_requirement.nil?
- current_state = find_state_for(current_requirement)
- return states.index(current_state) if state_any?(current_state)
- current_requirement = parent_of(current_requirement)
+ index = -1
+ [current_requirement, existing_requirement].each do |r|
+ until r.nil?
+ current_state = find_state_for(r)
+ if state_any?(current_state)
+ current_index = states.index(current_state)
+ index = current_index if current_index > index
+ break
+ end
+ r = parent_of(r)
+ end
end
- until existing_requirement.nil?
- existing_state = find_state_for(existing_requirement)
- return states.index(existing_state) if state_any?(existing_state)
- existing_requirement = parent_of(existing_requirement)
- end
- -1
+ index
end
# @return [Object] the requirement that led to `requirement` being added