aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-06-14 11:19:52 +0200
committerJosé Valim <jose.valim@plataformatec.com.br>2012-06-14 11:19:52 +0200
commit723330b4bc24f337b5a1ab3271c6b85ccbe4bafd (patch)
tree25c843d983b44792af7e36364f39dad6a1917c15 /lib/bundler/source.rb
parent2d4f8ddaccfe6fc460045b93b0c3e44715a94c98 (diff)
downloadbundler-723330b4bc24f337b5a1ab3271c6b85ccbe4bafd.tar.gz
Add config disable_local_branch_check, closes #1985
Diffstat (limited to 'lib/bundler/source.rb')
-rw-r--r--lib/bundler/source.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index aa05afa5..d9d5dc64 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -716,6 +716,12 @@ module Bundler
path = Pathname.new(path)
path = path.expand_path(Bundler.root) unless path.relative?
+ unless options["branch"] || Bundler.settings[:disable_local_branch_check]
+ raise GitError, "Cannot use local override for #{name} at #{path} because " \
+ ":branch is not specified in Gemfile. Specify a branch or use " \
+ "`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"
@@ -727,7 +733,7 @@ module Bundler
# so the Gemfile.lock always picks up the new revision.
@git_proxy = GitProxy.new(path, uri, ref)
- if options["branch"] and git_proxy.branch != options["branch"]
+ if git_proxy.branch != options["branch"] && !Bundler.settings[:disable_local_branch_check]
raise GitError, "Local override for #{name} at #{path} is using branch " \
"#{git_proxy.branch} but Gemfile specifies #{options["branch"]}"
end