summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2012-03-20 17:25:49 -0700
committerTerence Lee <hone02@gmail.com>2012-03-20 17:28:41 -0700
commitd24e788a9fbe84d632bad4b185aa09ccd7a4d919 (patch)
treeb81174b12c74a9245722115d951d6d9d2edb984e
parentb8d0a414067f08b7a57b11b295034f5b88db9fc9 (diff)
downloadbundler-d24e788a9fbe84d632bad4b185aa09ccd7a4d919.tar.gz
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 https://github.com/carlhuda/bundler/commit/e31a1c7b24d3dfbce7ed39b6a723dd20f7d08c95#L1R51. We should only remove the duplicate GIT sources, so let's explicitly check for that.
-rw-r--r--lib/bundler/lockfile_parser.rb2
-rw-r--r--spec/install/deploy_spec.rb14
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 813f24ace3..eca9183a55 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -49,7 +49,7 @@ module Bundler
@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
diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb
index 5678e4cced..eb98f5ad25 100644
--- a/spec/install/deploy_spec.rb
+++ b/spec/install/deploy_spec.rb
@@ -53,6 +53,20 @@ describe "install with --deployment or --frozen" do
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"