summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-13 19:17:27 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-13 19:17:27 +0200
commit6df7af763cb3d8b13568ca12199ca778cccbe405 (patch)
tree31b346623892a8888d74a3c74582f77bf5a9235c
parent9bf8742fcc9d582f67c6332eca74f27672075a30 (diff)
downloadbundler-seg-no-warning-when-updating-sha-not-version.tar.gz
Grab previous sources early enough (before they change)seg-no-warning-when-updating-sha-not-version
And make sure the revision is actually fetched, by saving to "to_s" version, that includes it.
-rw-r--r--lib/bundler/cli/update.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb
index 0c41aa965a..75ba12015a 100644
--- a/lib/bundler/cli/update.rb
+++ b/lib/bundler/cli/update.rb
@@ -58,6 +58,14 @@ module Bundler
Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
Bundler.definition.validate_runtime!
+
+ if locked_gems = Bundler.definition.locked_gems
+ previous_locked_specs = locked_gems.specs.reduce({}) do |h, s|
+ h[s.name] = { :version => s.version, :source => s.source.to_s }
+ h
+ end
+ end
+
installer = Installer.install Bundler.root, Bundler.definition, opts
Bundler.load.cache if Bundler.app_cache.exist?
@@ -66,12 +74,12 @@ module Bundler
Bundler::CLI::Clean.new(options).run
end
- if locked_gems = Bundler.definition.locked_gems
+ if locked_gems
gems.each do |name|
- locked_spec = locked_gems.specs.find {|s| s.name == name }
+ locked_spec = previous_locked_specs[name]
next unless locked_spec
- locked_source = locked_spec.source
- locked_version = locked_spec.version
+ locked_source = locked_spec[:source]
+ locked_version = locked_spec[:version]
new_spec = Bundler.definition.specs[name].first
new_source = new_spec.source.to_s
new_version = new_spec.version