summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-19 12:50:17 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-19 12:50:17 -0700
commitc26b2c309432bdcc5397ac0d3bac3831c2a30929 (patch)
tree786271082a48ed0db561632a6f66af84f7b7cf06
parentacf0d935cfb1144799d094374e637b2475e53aec (diff)
downloadbundler-c26b2c309432bdcc5397ac0d3bac3831c2a30929.tar.gz
Fix bug where bundle update foo wasn't working in many git cases
-rwxr-xr-xbin/bundle3
-rw-r--r--lib/bundler/source.rb2
-rw-r--r--spec/update/git_spec.rb16
3 files changed, 18 insertions, 3 deletions
diff --git a/bin/bundle b/bin/bundle
index d2e50814b5..f7b0dbc6cf 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -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 \ No newline at end of file
+end
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index e765c47628..68c49ef3a1 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -623,7 +623,7 @@ module Bundler
def has_revision_cached?
return unless @revision
- git %|cat-file -t #{@revision}|
+ in_cache { git %|cat-file -t #{@revision}| }
$? == 0
end
diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb
index 8f9f125c52..4b0f82edb5 100644
--- a/spec/update/git_spec.rb
+++ b/spec/update/git_spec.rb
@@ -21,6 +21,20 @@ describe "bundle update" do
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 @@ describe "bundle update" do
out.should include("Your bundle is complete!")
end
end
-end \ No newline at end of file
+end