Skip to content
Browse files

Fixes #1782. Don't remove duplicate PATH sources

When using specifying version number, you can have multiple PATH
sections for the same source.

We were over eager in
e31a1c7#L1R51.
We should only remove the duplicate GIT sources, so let's explicitly
check for that.
  • Loading branch information...
1 parent b8d0a41 commit d24e788a9fbe84d632bad4b185aa09ccd7a4d919 @hone hone committed Mar 20, 2012
Showing with 15 additions and 1 deletion.
  1. +1 −1 lib/bundler/lockfile_parser.rb
  2. +14 −0 spec/install/deploy_spec.rb
View
2 lib/bundler/lockfile_parser.rb
@@ -49,7 +49,7 @@ def parse_source(line)
@current_source = TYPES[@type].from_lock(@opts)
# Strip out duplicate GIT sections
- if @sources.include?(@current_source)
+ if @sources.include?(@current_source) && @current_source.is_a?(Bundler::Source::Git)
@current_source = @sources.find { |s| s == @current_source }
end
View
14 spec/install/deploy_spec.rb
@@ -53,6 +53,20 @@
exitstatus.should == 0
end
+ it "works when using path gems from the same path and the version is specified" do
+ build_lib "foo", :path => lib_path("nested/foo")
+ build_lib "bar", :path => lib_path("nested/bar")
+ gemfile <<-G
+ gem "foo", "1.0", :path => "#{lib_path("nested")}"
+ gem "bar", :path => "#{lib_path("nested")}"
+ G
+
+ bundle :install
+ bundle "install --deployment", :exitstatus => true
+
+ exitstatus.should == 0
+ end
+
describe "with an existing lockfile" do
before do
bundle "install"

1 comment on commit d24e788

@joemsak

Thank you!

Please sign in to comment.
Something went wrong with that request. Please try again.