diff options
author | Carl Lerche <carllerche@mac.com> | 2010-07-20 21:16:38 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-07-20 21:16:38 -0700 |
commit | 24dc61a64fc92a485eded6a2108fa65346c98b8e (patch) | |
tree | 4ad63f872a7445b5c69eaf08879b6074e30eb2bd | |
parent | ab3173ebc1b2657de4309b3eaadb3038dea4bc4c (diff) | |
download | bundler-24dc61a64fc92a485eded6a2108fa65346c98b8e.tar.gz |
Fix a bug where bundle installs spews errors when it is run multiple times in a row with a git source
-rw-r--r-- | lib/bundler/source.rb | 4 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 12 | ||||
-rw-r--r-- | spec/support/helpers.rb | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 4032f1be94..925e64aca3 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -523,7 +523,7 @@ module Bundler # TODO: actually cache git specs def specs - if (@allow_remote || @allow_cached) && !@update + if allow_git_ops? && !@update # Start by making sure the git cache is up to date cache checkout @@ -537,7 +537,7 @@ module Bundler unless @installed Bundler.ui.debug " * Checking out revision: #{ref}" - checkout + checkout if allow_git_ops? @installed = true end generate_bin(spec) diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index a40f5bbd12..e02a2ad44e 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -398,4 +398,16 @@ describe "bundle install with git sources" do bundle "install" out.should_not =~ /updating/i end + + it "doesn't blow up if bundle install is run twice in a row" do + build_git "foo" + + gemfile <<-G + gem "foo", :git => "#{lib_path('foo-1.0')}" + G + + bundle "install" + bundle "install", :exit_status => true + exitstatus.should == 0 + end end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 63dd7eb76a..13de050865 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -15,7 +15,7 @@ module Spec Gem.configuration.write end - attr_reader :out, :err + attr_reader :out, :err, :exitstatus def in_app_root(&blk) Dir.chdir(bundled_app, &blk) |