Permalink
Browse files

Fix bug where bundle update foo wasn't working in many git cases

  • Loading branch information...
1 parent acf0d93 commit c26b2c309432bdcc5397ac0d3bac3831c2a30929 Carlhuda committed Jul 19, 2010
Showing with 18 additions and 3 deletions.
  1. +2 −1 bin/bundle
  2. +1 −1 lib/bundler/source.rb
  3. +15 −1 spec/update/git_spec.rb
View
@@ -13,8 +13,9 @@ begin
Bundler::CLI.start
rescue Bundler::BundlerError => e
Bundler.ui.error e.message
+ Bundler.ui.error e.backtrace.join("\n") if ENV["BUNDLE_DEBUG"]
exit e.status_code
rescue Interrupt
Bundler.ui.error "\nQuitting..."
exit 1
-end
+end
@@ -623,7 +623,7 @@ def checkout
def has_revision_cached?
return unless @revision
- git %|cat-file -t #{@revision}|
+ in_cache { git %|cat-file -t #{@revision}| }
$? == 0
end
@@ -21,6 +21,20 @@
should_be_installed "foo 1.1"
end
+ it "updates correctly when you have like craziness" do
+ build_lib "activesupport", "3.0", :path => lib_path("rails/activesupport")
+ build_git "rails", "3.0", :path => lib_path("rails") do |s|
+ s.add_dependency "activesupport", "= 3.0"
+ end
+
+ install_gemfile <<-G
+ gem "rails", :git => "#{lib_path('rails')}"
+ G
+
+ bundle "update rails"
+ out.should include("Using activesupport (3.0) from #{lib_path('rails')} (at master)")
+ should_be_installed "rails 3.0", "activesupport 3.0"
+ end
it "floats on a branch when :branch is used and the source is specified in the update" do
build_git "foo", "1.0", :path => lib_path("foo")
update_git "foo", :branch => "omg", :path => lib_path("foo")
@@ -59,4 +73,4 @@
out.should include("Your bundle is complete!")
end
end
-end
+end

0 comments on commit c26b2c3

Please sign in to comment.