summaryrefslogtreecommitdiff
path: root/lib/bundler/lockfile_parser.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-07 14:07:29 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-07 15:31:52 +0900
commitc082c6eb7c786a432bea23cf78839f64585cb630 (patch)
treee3c608264fe03645e905fe7284d713cff87b87dd /lib/bundler/lockfile_parser.rb
parent6e2240a2f954c84ed12357382c9c065ae4b91e11 (diff)
Sync RubyGems and Bundler with upstream
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4634
Diffstat (limited to 'lib/bundler/lockfile_parser.rb')
-rw-r--r--lib/bundler/lockfile_parser.rb22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index f87faff70c..afc21fd006 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -1,16 +1,5 @@
# frozen_string_literal: true
-#--
-# Some versions of the Bundler 1.1 RC series introduced corrupted
-# lockfiles. There were two major problems:
-#
-# * multiple copies of the same GIT section appeared in the lockfile
-# * when this happened, those sections got multiple copies of gems
-# in those sections.
-#
-# As a result, Bundler 1.1 contains code that fixes the earlier
-# corruption. We will remove this fix-up code in Bundler 1.2.
-
module Bundler
class LockfileParser
attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version
@@ -124,12 +113,7 @@ module Bundler
@sources << @current_source
when GIT
@current_source = TYPES[@type].from_lock(@opts)
- # Strip out duplicate GIT sections
- if @sources.include?(@current_source)
- @current_source = @sources.find {|s| s == @current_source }
- else
- @sources << @current_source
- end
+ @sources << @current_source
when GEM
@opts["remotes"] = Array(@opts.delete("remote")).reverse
@current_source = TYPES[@type].from_lock(@opts)
@@ -212,9 +196,7 @@ module Bundler
@current_spec = LazySpecification.new(name, version, platform)
@current_spec.source = @current_source
- # Avoid introducing multiple copies of the same spec (caused by
- # duplicate GIT sections)
- @specs[@current_spec.identifier] ||= @current_spec
+ @specs[@current_spec.identifier] = @current_spec
elsif spaces.size == 6
version = version.split(",").map(&:strip) if version
dep = Gem::Dependency.new(name, version)