diff options
author | André Arko <andre@arko.net> | 2012-06-12 21:58:12 -0700 |
---|---|---|
committer | André Arko <andre@arko.net> | 2012-06-12 21:58:12 -0700 |
commit | 734342914f367144e4e5400916ca224164fc09b1 (patch) | |
tree | 6ff1fd168d2f1cf3b3d9abe869081f6f02e85a4a | |
parent | d748a83e18b2a0c0cd307911b3a3c7020302596a (diff) | |
parent | 15e0519b8c52f28d81a9e067e4c39cb1e5470b2d (diff) | |
download | bundler-734342914f367144e4e5400916ca224164fc09b1.tar.gz |
Merge pull request #1980 from phil-monroe/master
Remove all requirements from local override
-rw-r--r-- | lib/bundler/source.rb | 11 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 23 |
2 files changed, 2 insertions, 32 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index f5d55a0d79..c708791d48 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -716,12 +716,6 @@ module Bundler path = Pathname.new(path) path = path.expand_path(Bundler.root) unless path.relative? - unless options["branch"] - raise GitError, "Cannot use local override for #{name} at #{path} because " \ - ":branch is not specified in Gemfile. Specify a branch or check " \ - "`bundle config --delete` to remove the local override" - end - unless path.exist? raise GitError, "Cannot use local override for #{name} because #{path} " \ "does not exist. Check `bundle config --delete` to remove the local override" @@ -733,11 +727,6 @@ module Bundler # so the Gemfile.lock always picks up the new revision. @git_proxy = GitProxy.new(path, uri, ref) - if git_proxy.branch != options["branch"] - raise GitError, "Local override for #{name} at #{path} is using branch " \ - "#{git_proxy.branch} but Gemfile specifies #{options["branch"]}" - end - changed = cached_revision && cached_revision != git_proxy.revision if changed && !git_proxy.contains?(cached_revision) diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index 048880bab5..85c60aa3b9 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -254,7 +254,7 @@ describe "bundle install with git sources" do out.should =~ /Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/ end - it "explodes if branch is not given" do + it "does not explode if branch, tag, or ref is not given" do build_git "rack", "0.8" FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack')) @@ -265,26 +265,7 @@ describe "bundle install with git sources" do bundle %|config local.rack #{lib_path('local-rack')}| bundle :install - out.should =~ /because :branch is not specified in Gemfile/ - end - - it "explodes on different branches" do - build_git "rack", "0.8" - - FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack')) - - update_git "rack", "0.8", :path => lib_path('local-rack'), :branch => "another" do |s| - s.write "lib/rack.rb", "puts :LOCAL" - end - - install_gemfile <<-G - source "file://#{gem_repo1}" - gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master" - G - - bundle %|config local.rack #{lib_path('local-rack')}| - bundle :install - out.should =~ /is using branch another but Gemfile specifies master/ + out.should_not =~ /is not specified in Gemfile/ end it "explodes on invalid revision" do |